pynintendoparental 2.3.0__py3-none-any.whl → 2.3.2.1__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/__init__.py +39 -4
- pynintendoparental/_version.py +1 -1
- pynintendoparental/api.py +18 -43
- pynintendoparental/application.py +66 -24
- pynintendoparental/authenticator.py +27 -1
- pynintendoparental/const.py +5 -3
- pynintendoparental/device.py +410 -178
- pynintendoparental/player.py +33 -4
- {pynintendoparental-2.3.0.dist-info → pynintendoparental-2.3.2.1.dist-info}/METADATA +6 -6
- pynintendoparental-2.3.2.1.dist-info/RECORD +17 -0
- {pynintendoparental-2.3.0.dist-info → pynintendoparental-2.3.2.1.dist-info}/WHEEL +1 -1
- pynintendoparental-2.3.0.dist-info/RECORD +0 -17
- {pynintendoparental-2.3.0.dist-info → pynintendoparental-2.3.2.1.dist-info}/licenses/LICENSE +0 -0
- {pynintendoparental-2.3.0.dist-info → pynintendoparental-2.3.2.1.dist-info}/top_level.txt +0 -0
pynintendoparental/player.py
CHANGED
|
@@ -4,7 +4,18 @@ from .const import _LOGGER
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class Player:
|
|
7
|
-
"""
|
|
7
|
+
"""A Nintendo Switch user profile.
|
|
8
|
+
|
|
9
|
+
Represents a player profile on a Nintendo Switch console with their gaming activity.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
player_id: Unique identifier for the player.
|
|
13
|
+
nickname: Player's display name.
|
|
14
|
+
player_image: URL to the player's Mii image.
|
|
15
|
+
playing_time: Total playing time for the current day in minutes.
|
|
16
|
+
apps: List of applications played today with playtime details.
|
|
17
|
+
month_summary: Monthly usage summary data for this player.
|
|
18
|
+
"""
|
|
8
19
|
|
|
9
20
|
def __init__(self):
|
|
10
21
|
"""Init a player."""
|
|
@@ -16,7 +27,11 @@ class Player:
|
|
|
16
27
|
self.playing_time: int = 0
|
|
17
28
|
|
|
18
29
|
def update_from_daily_summary(self, raw: list[dict]):
|
|
19
|
-
"""Update
|
|
30
|
+
"""Update player data from a daily summary response.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
raw: List of daily summary dictionaries from the API.
|
|
34
|
+
"""
|
|
20
35
|
_LOGGER.debug("Updating player %s daily summary", self.player_id)
|
|
21
36
|
for player in raw[0].get("players", []):
|
|
22
37
|
if self.player_id == player["profile"].get("playerId"):
|
|
@@ -28,7 +43,14 @@ class Player:
|
|
|
28
43
|
|
|
29
44
|
@classmethod
|
|
30
45
|
def from_device_daily_summary(cls, raw: list[dict]) -> list["Player"]:
|
|
31
|
-
"""
|
|
46
|
+
"""Create Player objects from a device daily summary response.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
raw: List of daily summary dictionaries from the API.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
List of Player objects parsed from the summary.
|
|
53
|
+
"""
|
|
32
54
|
players = []
|
|
33
55
|
_LOGGER.debug("Building players from device daily summary.")
|
|
34
56
|
for player in raw[0].get("players", []):
|
|
@@ -44,7 +66,14 @@ class Player:
|
|
|
44
66
|
|
|
45
67
|
@classmethod
|
|
46
68
|
def from_profile(cls, raw: dict) -> "Player":
|
|
47
|
-
"""
|
|
69
|
+
"""Create a Player object from a profile response.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
raw: Profile dictionary from the API.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
A Player object parsed from the profile data.
|
|
76
|
+
"""
|
|
48
77
|
parsed = cls()
|
|
49
78
|
parsed.player_id = raw.get("playerId")
|
|
50
79
|
parsed.player_image = raw.get("imageUri")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pynintendoparental
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2.1
|
|
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
|
|
@@ -14,14 +14,14 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: pynintendoauth==1.0.2
|
|
15
15
|
Provides-Extra: dev
|
|
16
16
|
Requires-Dist: aiofiles<26,>=23; extra == "dev"
|
|
17
|
-
Requires-Dist: bandit<1.
|
|
17
|
+
Requires-Dist: bandit<1.10,>=1.7; extra == "dev"
|
|
18
18
|
Requires-Dist: black<26,>=23; extra == "dev"
|
|
19
|
-
Requires-Dist: build<1.
|
|
20
|
-
Requires-Dist: Faker<
|
|
19
|
+
Requires-Dist: build<1.5,>=0.10; extra == "dev"
|
|
20
|
+
Requires-Dist: Faker<41,>=38; extra == "dev"
|
|
21
21
|
Requires-Dist: flake8<8,>=6; extra == "dev"
|
|
22
|
-
Requires-Dist: isort<
|
|
22
|
+
Requires-Dist: isort<8,>=5; extra == "dev"
|
|
23
23
|
Requires-Dist: mypy<1.20,>=1.5; extra == "dev"
|
|
24
|
-
Requires-Dist: pytest<
|
|
24
|
+
Requires-Dist: pytest<10,>=7; extra == "dev"
|
|
25
25
|
Requires-Dist: pytest-cov<8,>=4; extra == "dev"
|
|
26
26
|
Requires-Dist: pytest-asyncio<2.0,>=0.21; extra == "dev"
|
|
27
27
|
Requires-Dist: syrupy<6,>=5; extra == "dev"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
pynintendoparental/__init__.py,sha256=gqfhj2UupWxhkgPP6ZWCsdT5mKc4fC8eIvpD1BGw7Uk,3861
|
|
2
|
+
pynintendoparental/_version.py,sha256=jgnnx5cGF7qlNQ_bo1E-fLsSJroQ8iPchuoCwV9fLNE,24
|
|
3
|
+
pynintendoparental/api.py,sha256=h-PRnujmlvqsGO4v3AqT05XcFzz-xFg7qn__1yKbdko,7076
|
|
4
|
+
pynintendoparental/application.py,sha256=LyJZFKa1VRy_Qzq6QDqZJynY_Pl7Feu7F8KeAeSpzqg,6755
|
|
5
|
+
pynintendoparental/authenticator.py,sha256=BYx_HwlApkhgOhZbfDQI18JXelG2H2BT51BvVeIB8rc,1425
|
|
6
|
+
pynintendoparental/const.py,sha256=L_9XcEKA9eD1SIImbGcZ4cEHw8yjgbDVRwHS5-QzTqg,2225
|
|
7
|
+
pynintendoparental/device.py,sha256=Q6D3EY4SNho1JGr52oDjycd96La4zMIg8B6-5wjfH0o,40045
|
|
8
|
+
pynintendoparental/enum.py,sha256=orYspYYuiBeIbb1Scgkj0m3Cn_rV-wLBr-ozG1v6azk,1169
|
|
9
|
+
pynintendoparental/exceptions.py,sha256=o1vpVIwa3CHyIxxqGjYX1hk2G5RMcZJN1T7lCA-fKzc,1308
|
|
10
|
+
pynintendoparental/player.py,sha256=NqbR1-Z7hHGn3GNkY6np9lsJGfrN8fAKmgrjoloESac,2940
|
|
11
|
+
pynintendoparental/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
pynintendoparental/utils.py,sha256=gLMibsEOnKUZJgCQKF4Zk517fawZ3mBqMK6MS2g-Um0,199
|
|
13
|
+
pynintendoparental-2.3.2.1.dist-info/licenses/LICENSE,sha256=zsxHgHVMnyWq121yND8zBl9Rl9H6EF2K9N51B2ZSm_k,1071
|
|
14
|
+
pynintendoparental-2.3.2.1.dist-info/METADATA,sha256=19gBwbUPYLtjoM6aYTBrPUAbR2RKR-QuuyoXJ31GgHs,12676
|
|
15
|
+
pynintendoparental-2.3.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
16
|
+
pynintendoparental-2.3.2.1.dist-info/top_level.txt,sha256=QQ5bAl-Ljso16P8KLf1NHrFmKk9jLT7bVJG_rVlIXWk,19
|
|
17
|
+
pynintendoparental-2.3.2.1.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
pynintendoparental/__init__.py,sha256=gO3rH9gukrFoACVkdqj_liqcgtHxSZlitE0PrVQZGok,2334
|
|
2
|
-
pynintendoparental/_version.py,sha256=CpK8IH_dCUAwg9tqv7zm9FxbBFkxCnED1JUiRe7cftU,22
|
|
3
|
-
pynintendoparental/api.py,sha256=B3fNI3EGdZZissOeX1umVo8svvXPIMMKWnWOkW1wJ0o,7357
|
|
4
|
-
pynintendoparental/application.py,sha256=4_38VBtoKddIXRRsegX9DB-BJ_CYIO4FhE1xC-VliOs,4961
|
|
5
|
-
pynintendoparental/authenticator.py,sha256=WPAEAUKmIymIiQUXILYt4B2_3UgYRKEVi6btJRwzjmM,430
|
|
6
|
-
pynintendoparental/const.py,sha256=owbzynb3eljPtvYr5vtg-B4UAIS5SGyumR8HDG6eB2Q,2201
|
|
7
|
-
pynintendoparental/device.py,sha256=TgvEH2VrvwY8j5sLeTT3dK6wMY2l5sY8TmP_AitpHgM,29553
|
|
8
|
-
pynintendoparental/enum.py,sha256=orYspYYuiBeIbb1Scgkj0m3Cn_rV-wLBr-ozG1v6azk,1169
|
|
9
|
-
pynintendoparental/exceptions.py,sha256=o1vpVIwa3CHyIxxqGjYX1hk2G5RMcZJN1T7lCA-fKzc,1308
|
|
10
|
-
pynintendoparental/player.py,sha256=Zh3vi0IdOHtn5KW0tT9JigB315ftjQ4uEQylF3D4LWs,2084
|
|
11
|
-
pynintendoparental/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
pynintendoparental/utils.py,sha256=gLMibsEOnKUZJgCQKF4Zk517fawZ3mBqMK6MS2g-Um0,199
|
|
13
|
-
pynintendoparental-2.3.0.dist-info/licenses/LICENSE,sha256=zsxHgHVMnyWq121yND8zBl9Rl9H6EF2K9N51B2ZSm_k,1071
|
|
14
|
-
pynintendoparental-2.3.0.dist-info/METADATA,sha256=GXHJTrj8EoZTp9vs0L1JtAfy75NFuWV744IC6kAXemo,12672
|
|
15
|
-
pynintendoparental-2.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
-
pynintendoparental-2.3.0.dist-info/top_level.txt,sha256=QQ5bAl-Ljso16P8KLf1NHrFmKk9jLT7bVJG_rVlIXWk,19
|
|
17
|
-
pynintendoparental-2.3.0.dist-info/RECORD,,
|
{pynintendoparental-2.3.0.dist-info → pynintendoparental-2.3.2.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|