diff --git a/src/aioswitcher/bridge.py b/src/aioswitcher/bridge.py index c6a46b15..d9ba81f6 100644 --- a/src/aioswitcher/bridge.py +++ b/src/aioswitcher/bridge.py @@ -32,10 +32,10 @@ ShutterDirection, SwitcherBase, SwitcherDualShutterSingleLight, + SwitcherLight, SwitcherPowerPlug, SwitcherShutter, SwitcherSingleShutterDualLight, - SwitcherLight, SwitcherThermostat, SwitcherWaterHeater, ThermostatFanLevel, @@ -249,10 +249,7 @@ def _parse_device_from_datagram( parser.get_thermostat_remote_id(), ) ) - elif ( - device_type - and device_type.category == DeviceCategory.LIGHT - ): + elif device_type and device_type.category == DeviceCategory.LIGHT: logger.debug("discovered a Light SL01 switcher device") device_callback( SwitcherLight( diff --git a/src/aioswitcher/device/tools.py b/src/aioswitcher/device/tools.py index cf033f81..e3d4646e 100644 --- a/src/aioswitcher/device/tools.py +++ b/src/aioswitcher/device/tools.py @@ -274,7 +274,11 @@ def get_light_discovery_packet_index( if circuit_number not in [0, 1]: raise ValueError("Invalid circuit number") return circuit_number - if device_type in (DeviceType.RUNNER_S12, DeviceType.LIGHT_SL01, DeviceType.LIGHT_SL01_MINI): + if device_type in ( + DeviceType.RUNNER_S12, + DeviceType.LIGHT_SL01, + DeviceType.LIGHT_SL01_MINI, + ): if circuit_number != 0: raise ValueError("Invalid circuit number") return 0 diff --git a/tests/test_device_parsing.py b/tests/test_device_parsing.py index b9425be6..84377a84 100644 --- a/tests/test_device_parsing.py +++ b/tests/test_device_parsing.py @@ -25,9 +25,9 @@ from aioswitcher.device import ( DeviceState, SwitcherDualShutterSingleLight, + SwitcherLight, SwitcherPowerPlug, SwitcherShutter, - SwitcherLight, SwitcherSingleShutterDualLight, SwitcherThermostat, SwitcherWaterHeater,