Skip to content

Commit

Permalink
2024.3.1 (#92)
Browse files Browse the repository at this point in the history
* bump pynintendoparental
* configure loggers
* only send request to update_max_daily_playtime if value is different
* fix validation
  • Loading branch information
pantherale0 committed Mar 10, 2024
1 parent 26976db commit 32aa66f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions custom_components/nintendo_parental/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"documentation": "https://github.com/pantherale0/ha-nintendoparentalcontrols",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/pantherale0/ha-nintendoparentalcontrols/issues",
"loggers": [
"nintendo_parental",
"pynintendoparental"
],
"requirements": [
"pynintendoparental==0.4.9"
"pynintendoparental==0.4.10"
],
"version": "2024.3.0"
"version": "2024.3.1"
}
6 changes: 5 additions & 1 deletion custom_components/nintendo_parental/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def native_value(self) -> float | None:
"""Return the state of the entity."""
if self._device.limit_time is None:
return -1
return float(self._device.limit_time)
return self._device.limit_time

@property
def name(self) -> str:
Expand All @@ -62,6 +62,10 @@ def name(self) -> str:

async def async_set_native_value(self, value: float) -> None:
"""Update the state of the entity."""
_LOGGER.debug(">> ScreenTimeEntity.async_set_native_value(value=%s)",
value)
if value == self.native_value:
return True
if value > 360:
raise ServiceValidationError(
"Play Time Limit cannot be more than 6 hours.",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ colorlog==6.8.0
homeassistant==2024.2.0
pip>=21.0,<23.4
ruff==0.1.9
pynintendoparental==0.4.9
pynintendoparental==0.4.10

0 comments on commit 32aa66f

Please sign in to comment.