pynintendoparental 1.0.2__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pynintendoparental/_version.py +1 -1
- pynintendoparental/device.py +27 -14
- {pynintendoparental-1.0.2.dist-info → pynintendoparental-1.0.3.dist-info}/METADATA +2 -2
- {pynintendoparental-1.0.2.dist-info → pynintendoparental-1.0.3.dist-info}/RECORD +7 -7
- {pynintendoparental-1.0.2.dist-info → pynintendoparental-1.0.3.dist-info}/WHEEL +0 -0
- {pynintendoparental-1.0.2.dist-info → pynintendoparental-1.0.3.dist-info}/licenses/LICENSE +0 -0
- {pynintendoparental-1.0.2.dist-info → pynintendoparental-1.0.3.dist-info}/top_level.txt +0 -0
pynintendoparental/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.0.
|
|
1
|
+
__version__ = "1.0.3"
|
pynintendoparental/device.py
CHANGED
|
@@ -373,26 +373,42 @@ class Device:
|
|
|
373
373
|
self.alarms_enabled,
|
|
374
374
|
self.device_id)
|
|
375
375
|
|
|
376
|
-
async def get_monthly_summary(self, search_date: datetime = None):
|
|
376
|
+
async def get_monthly_summary(self, search_date: datetime = None) -> dict | None:
|
|
377
377
|
"""Gets the monthly summary."""
|
|
378
378
|
_LOGGER.debug(">> Device.get_monthly_summary(search_date=%s)", search_date)
|
|
379
379
|
latest = False
|
|
380
380
|
if search_date is None:
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
381
|
+
try:
|
|
382
|
+
response = await self._api.async_get_device_monthly_summaries(
|
|
383
|
+
device_id=self.device_id
|
|
384
|
+
)
|
|
385
|
+
except HttpException as exc:
|
|
386
|
+
_LOGGER.debug("Could not retrieve monthly summaries: %s", exc)
|
|
387
|
+
return
|
|
388
|
+
else:
|
|
389
|
+
available_summaries = response["json"]["available"]
|
|
390
|
+
_LOGGER.debug("Available monthly summaries: %s", available_summaries)
|
|
391
|
+
if not available_summaries:
|
|
392
|
+
_LOGGER.debug("No monthly summaries available for device %s", self.device_id)
|
|
393
|
+
return None
|
|
394
|
+
# Use the most recent available summary
|
|
395
|
+
available_summary = available_summaries[0]
|
|
396
|
+
search_date = datetime.strptime(f"{available_summary['year']}-{available_summary['month']}-01", "%Y-%m-%d")
|
|
397
|
+
_LOGGER.debug("Using search date %s for monthly summary request", search_date)
|
|
398
|
+
latest = True
|
|
389
399
|
|
|
390
400
|
try:
|
|
391
401
|
response = await self._api.async_get_device_monthly_summary(
|
|
392
|
-
device_id
|
|
402
|
+
device_id=self.device_id,
|
|
393
403
|
year=search_date.year,
|
|
394
404
|
month=search_date.month
|
|
395
405
|
)
|
|
406
|
+
except HttpException as exc:
|
|
407
|
+
_LOGGER.warning("HTTP Exception raised while getting monthly summary for device %s: %s",
|
|
408
|
+
self.device_id,
|
|
409
|
+
exc)
|
|
410
|
+
return None
|
|
411
|
+
else:
|
|
396
412
|
_LOGGER.debug("Monthly summary query complete for device %s: %s",
|
|
397
413
|
self.device_id,
|
|
398
414
|
response["json"]["summary"])
|
|
@@ -400,10 +416,7 @@ class Device:
|
|
|
400
416
|
self.last_month_summary = summary = response["json"]["summary"]
|
|
401
417
|
return summary
|
|
402
418
|
return response["json"]["summary"]
|
|
403
|
-
|
|
404
|
-
_LOGGER.warning("HTTP Exception raised while getting monthly summary for device %s: %s",
|
|
405
|
-
self.device_id,
|
|
406
|
-
exc)
|
|
419
|
+
|
|
407
420
|
|
|
408
421
|
def get_date_summary(self, input_date: datetime = datetime.now()) -> dict:
|
|
409
422
|
"""Returns usage for a given date."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pynintendoparental
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: A Python module to interact with Nintendo Parental Controls
|
|
5
5
|
Home-page: http://github.com/pantherale0/pynintendoparental
|
|
6
6
|
Author: pantherale0
|
|
@@ -17,7 +17,7 @@ Requires-Dist: black<26,>=23; extra == "dev"
|
|
|
17
17
|
Requires-Dist: build<1.3,>=0.10; extra == "dev"
|
|
18
18
|
Requires-Dist: flake8<8,>=6; extra == "dev"
|
|
19
19
|
Requires-Dist: isort<7,>=5; extra == "dev"
|
|
20
|
-
Requires-Dist: mypy<1.
|
|
20
|
+
Requires-Dist: mypy<1.18,>=1.5; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest<9,>=7; extra == "dev"
|
|
22
22
|
Requires-Dist: pytest-cov<7,>=4; extra == "dev"
|
|
23
23
|
Requires-Dist: twine<7,>=4; extra == "dev"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
pynintendoparental/__init__.py,sha256=CDz2tdO25y3vO3lLA6VQZOJl2Np10wgPIl8oWA4aGdE,2039
|
|
2
|
-
pynintendoparental/_version.py,sha256=
|
|
2
|
+
pynintendoparental/_version.py,sha256=2plzdEEb24FLjE2I2XyBBcJEPYWHccNL4SgtLC_6erg,22
|
|
3
3
|
pynintendoparental/api.py,sha256=WzsWhQQcexJ5PIdem0WrC5XZ4FtnIeA29XZmV6tfBp0,7027
|
|
4
4
|
pynintendoparental/application.py,sha256=l-oVwM4hrVVUf_2djQ7rJVya7LQP38yhaLPAWt8V8TY,3941
|
|
5
5
|
pynintendoparental/const.py,sha256=Ao38EeEXMOouY4DRgOfeytDY8Kwj3XAaiaCDteSJ7IE,2101
|
|
6
|
-
pynintendoparental/device.py,sha256=
|
|
6
|
+
pynintendoparental/device.py,sha256=ASyWcY8wwWPgq7mlJCnFIP7IeYw0HgSxgIktQUYp8Oo,22201
|
|
7
7
|
pynintendoparental/enum.py,sha256=lzacGti7fcQqAOROjB9782De7bOMYKSEM61SQd6aYG4,401
|
|
8
8
|
pynintendoparental/exceptions.py,sha256=5M3y0OLSRvX9Ly8D4981HqiKTNxxVqeyzPIuAekQ6J8,410
|
|
9
9
|
pynintendoparental/player.py,sha256=WDl0pspHgrV9lGhDp-NKlfP8DV4Yxe02aYaGg9wTTeg,1785
|
|
@@ -11,8 +11,8 @@ pynintendoparental/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
11
11
|
pynintendoparental/utils.py,sha256=5-EP_rmPnSSWtbi18Y226GtjLhF3PLONKwmRdiy7m2c,198
|
|
12
12
|
pynintendoparental/authenticator/__init__.py,sha256=dnmp6YjBJ0fQ5YWhWGJsAjj1ROxLihPPGr0PVJtTsgI,7589
|
|
13
13
|
pynintendoparental/authenticator/const.py,sha256=_nUJVC0U64j_n1LaQd_KDg0EWFcezb87bQyYYXpbPPY,917
|
|
14
|
-
pynintendoparental-1.0.
|
|
15
|
-
pynintendoparental-1.0.
|
|
16
|
-
pynintendoparental-1.0.
|
|
17
|
-
pynintendoparental-1.0.
|
|
18
|
-
pynintendoparental-1.0.
|
|
14
|
+
pynintendoparental-1.0.3.dist-info/licenses/LICENSE,sha256=zsxHgHVMnyWq121yND8zBl9Rl9H6EF2K9N51B2ZSm_k,1071
|
|
15
|
+
pynintendoparental-1.0.3.dist-info/METADATA,sha256=T6pA0zeYr7UQRNqK9cdMFIaCTrWx-bXZgZxKayg86nE,1871
|
|
16
|
+
pynintendoparental-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
pynintendoparental-1.0.3.dist-info/top_level.txt,sha256=QQ5bAl-Ljso16P8KLf1NHrFmKk9jLT7bVJG_rVlIXWk,19
|
|
18
|
+
pynintendoparental-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|