Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugwise_usb/messages/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,7 @@ def __init__( # noqa: PLR0913
self,
send_fn: Callable[[PlugwiseRequest, bool], Awaitable[PlugwiseResponse | None]],
mac: bytes,
*,
awake_duration: int,
maintenance_interval: int,
sleep_duration: int,
Expand Down Expand Up @@ -1430,6 +1431,7 @@ def __init__( # noqa: PLR0913
self,
send_fn: Callable[[PlugwiseRequest, bool], Awaitable[PlugwiseResponse | None]],
mac: bytes,
*,
temp_hum: bool,
lower_bound: int,
upper_bound: int,
Expand Down
10 changes: 5 additions & 5 deletions plugwise_usb/nodes/sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,11 @@ async def sed_configure(self) -> bool:
request = NodeSleepConfigRequest(
self._send,
self._mac_in_bytes,
self._battery_config.awake_duration,
self._battery_config.maintenance_interval,
self._battery_config.sleep_duration,
self._battery_config.clock_sync,
self._battery_config.clock_interval,
awake_duration=self._battery_config.awake_duration,
maintenance_interval=self._battery_config.maintenance_interval,
sleep_duration=self._battery_config.sleep_duration,
sync_clock=self._battery_config.clock_sync,
clock_interval=self._battery_config.clock_interval,
)
_LOGGER.debug(
"sed_configure | Device %s | awake_duration=%s | clock_interval=%s | clock_sync=%s | maintenance_interval=%s | sleep_duration=%s",
Expand Down
16 changes: 8 additions & 8 deletions plugwise_usb/nodes/sense.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,10 @@ async def _configure_sense_humidity_task(self) -> bool:
request = SenseConfigureHysteresisRequest(
self._send,
self._mac_in_bytes,
False,
humidity_lower_bound,
humidity_upper_bound,
self.humidity_direction,
temp_hum=False,
lower_bound=humidity_lower_bound,
upper_bound=humidity_upper_bound,
direction=self.humidity_direction,
)
if (response := await request.send()) is None:
self._log_configure_failed("humidity hysteresis")
Expand Down Expand Up @@ -777,10 +777,10 @@ async def _configure_sense_temperature_task(self) -> bool:
request = SenseConfigureHysteresisRequest(
self._send,
self._mac_in_bytes,
True,
temperature_lower_bound,
temperature_upper_bound,
self.temperature_direction,
temp_hum=True,
lower_bound=temperature_lower_bound,
upper_bound=temperature_upper_bound,
direction=self.temperature_direction,
)
if (response := await request.send()) is None:
_LOGGER.warning(
Expand Down
10 changes: 5 additions & 5 deletions tests/test_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1503,11 +1503,11 @@ async def test_creating_request_messages(self) -> None:
node_sleep_config_request = pw_requests.NodeSleepConfigRequest(
self.dummy_fn,
b"1111222233334444",
5, # Duration in seconds the SED will be awake for receiving commands
360, # Duration in minutes the SED will be in sleeping mode and not able to respond any command
1440, # Interval in minutes the node will wake up and able to receive commands
False, # Enable/disable clock sync
0, # Duration in minutes the node synchronize its clock
awake_duration=5, # Duration in seconds the SED will be awake for receiving commands
maintenance_interval=360, # Duration in minutes the SED will be in sleeping mode and not able to respond any command
sleep_duration=1440, # Interval in minutes the node will wake up and able to receive commands
sync_clock=False, # Enable/disable clock sync
clock_interval=0, # Duration in minutes the node synchronize its clock
)
assert (
node_sleep_config_request.serialize()
Expand Down