Skip to content

Commit b1be32d

Browse files
committed
sed_configure(): try-except response added for testing
1 parent deb96db commit b1be32d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugwise_usb/nodes/sed.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,12 @@ async def sed_configure( # pylint: disable=too-many-arguments
693693
maintenance_interval,
694694
sleep_duration,
695695
)
696-
if (response := await request.send()) is None:
696+
try:
697+
response = await request.send()
698+
except MessageError as exc:
699+
return False
700+
701+
if response is None:
697702
self._new_battery_config = BatteryConfig()
698703
_LOGGER.warning(
699704
"No response from %s to configure sleep settings request", self.name

0 commit comments

Comments
 (0)