Browse Source

Fix inheritance with smart plugs (#103)

J. Nick Koston 1 year ago
parent
commit
52afa7219f
2 changed files with 5 additions and 5 deletions
  1. 0 5
      switchbot/devices/bot.py
  2. 5 0
      switchbot/devices/device.py

+ 0 - 5
switchbot/devices/bot.py

@@ -100,11 +100,6 @@ class Switchbot(SwitchbotDeviceOverrideStateDuringConnection):
             "holdSeconds": _data[10],
         }
 
-    def switch_mode(self) -> bool | None:
-        """Return true or false from cache."""
-        # To get actual position call update() first.
-        return self._get_adv_value("switchMode")
-
     def is_on(self) -> bool | None:
         """Return switch state from cache."""
         # To get actual position call update() first.

+ 5 - 0
switchbot/devices/device.py

@@ -441,6 +441,11 @@ class SwitchbotBaseDevice:
             self._sb_adv_data = advertisement
         self._override_adv_data = None
 
+    def switch_mode(self) -> bool | None:
+        """Return true or false from cache."""
+        # To get actual position call update() first.
+        return self._get_adv_value("switchMode")
+
 
 class SwitchbotDevice(SwitchbotBaseDevice):
     """Base Representation of a Switchbot Device.