pynintendoparental 1.0.5__tar.gz → 1.1.0__tar.gz
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-1.0.5 → pynintendoparental-1.1.0}/PKG-INFO +3 -3
- pynintendoparental-1.1.0/pynintendoparental/_version.py +1 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/device.py +14 -9
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/exceptions.py +16 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/PKG-INFO +3 -3
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/requires.txt +2 -2
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/setup.py +2 -2
- pynintendoparental-1.0.5/pynintendoparental/_version.py +0 -1
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/LICENSE +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/README.md +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/__init__.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/api.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/application.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/authenticator/__init__.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/authenticator/const.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/const.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/enum.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/player.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/py.typed +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/utils.py +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/SOURCES.txt +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/dependency_links.txt +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/top_level.txt +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pyproject.toml +0 -0
- {pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pynintendoparental
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
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,9 +17,9 @@ Requires-Dist: black<26,>=23; extra == "dev"
|
|
|
17
17
|
Requires-Dist: build<1.4,>=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.19,>=1.5; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest<9,>=7; extra == "dev"
|
|
22
|
-
Requires-Dist: pytest-cov<
|
|
22
|
+
Requires-Dist: pytest-cov<8,>=4; extra == "dev"
|
|
23
23
|
Requires-Dist: twine<7,>=4; extra == "dev"
|
|
24
24
|
Dynamic: author
|
|
25
25
|
Dynamic: classifier
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.1.0"
|
|
@@ -8,7 +8,7 @@ from typing import Callable
|
|
|
8
8
|
|
|
9
9
|
from .api import Api
|
|
10
10
|
from .const import _LOGGER, DAYS_OF_WEEK
|
|
11
|
-
from .exceptions import HttpException
|
|
11
|
+
from .exceptions import HttpException, BedtimeOutOfRangeError
|
|
12
12
|
from .enum import AlarmSettingState, RestrictionMode
|
|
13
13
|
from .player import Player
|
|
14
14
|
from .utils import is_awaitable
|
|
@@ -121,20 +121,25 @@ class Device:
|
|
|
121
121
|
self._parse_parental_control_setting(response["json"])
|
|
122
122
|
await self._execute_callbacks()
|
|
123
123
|
|
|
124
|
-
async def set_bedtime_alarm(self,
|
|
124
|
+
async def set_bedtime_alarm(self, value: time):
|
|
125
125
|
"""Update the bedtime alarm for the device."""
|
|
126
|
-
_LOGGER.debug(">> Device.set_bedtime_alarm(
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
_LOGGER.debug(">> Device.set_bedtime_alarm(value=%s)",
|
|
127
|
+
value)
|
|
128
|
+
if not (
|
|
129
|
+
(16 <= value.hour <= 22) or
|
|
130
|
+
(value.hour == 23 and value.minute == 0) or
|
|
131
|
+
(value.hour == 0 and value.minute == 0)
|
|
132
|
+
):
|
|
133
|
+
raise BedtimeOutOfRangeError(value=value)
|
|
129
134
|
bedtime = {
|
|
130
|
-
"enabled":
|
|
135
|
+
"enabled": value.hour != 0 and value.minute != 0,
|
|
131
136
|
}
|
|
132
|
-
if
|
|
137
|
+
if bedtime["enabled"]:
|
|
133
138
|
bedtime = {
|
|
134
139
|
**bedtime,
|
|
135
140
|
"endingTime": {
|
|
136
|
-
"hour":
|
|
137
|
-
"minute":
|
|
141
|
+
"hour": value.hour,
|
|
142
|
+
"minute": value.minute
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
145
|
if self.timer_mode == "DAILY":
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Nintendo Parental exceptions."""
|
|
2
2
|
|
|
3
|
+
from datetime import time
|
|
4
|
+
|
|
3
5
|
class HttpException(Exception):
|
|
4
6
|
"""A HTTP error occured"""
|
|
5
7
|
def __init__(self, status_code: int, message: str) -> None:
|
|
@@ -19,3 +21,17 @@ class InvalidOAuthConfigurationException(HttpException):
|
|
|
19
21
|
|
|
20
22
|
class NoDevicesFoundException(Exception):
|
|
21
23
|
"""No devices were found for the account."""
|
|
24
|
+
|
|
25
|
+
class InputValidationError(Exception):
|
|
26
|
+
"""Input Validation Failed."""
|
|
27
|
+
value: object
|
|
28
|
+
error_key: str
|
|
29
|
+
|
|
30
|
+
class BedtimeOutOfRangeError(InputValidationError):
|
|
31
|
+
"""Bedtime is outside of the allowed range."""
|
|
32
|
+
|
|
33
|
+
error_key = "bedtime_alarm_out_of_range"
|
|
34
|
+
|
|
35
|
+
def __init__(self, value: object) -> None:
|
|
36
|
+
super().__init__()
|
|
37
|
+
self.value = value
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pynintendoparental
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
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,9 +17,9 @@ Requires-Dist: black<26,>=23; extra == "dev"
|
|
|
17
17
|
Requires-Dist: build<1.4,>=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.19,>=1.5; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest<9,>=7; extra == "dev"
|
|
22
|
-
Requires-Dist: pytest-cov<
|
|
22
|
+
Requires-Dist: pytest-cov<8,>=4; extra == "dev"
|
|
23
23
|
Requires-Dist: twine<7,>=4; extra == "dev"
|
|
24
24
|
Dynamic: author
|
|
25
25
|
Dynamic: classifier
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/authenticator/__init__.py
RENAMED
|
File without changes
|
{pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental/authenticator/const.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pynintendoparental-1.0.5 → pynintendoparental-1.1.0}/pynintendoparental.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|