Просмотр исходного кода

Reformat with black

This was supposed to autorun, but apparently is not working.
Jason Rumney 5 лет назад
Родитель
Сommit
bff0a886ee

+ 7 - 3
custom_components/tuya_local/dehumidifier/light.py

@@ -53,10 +53,12 @@ class GoldairDehumidifierLedDisplayLight(LightEntity):
     @property
     def is_on(self):
         """Return the current state."""
-        return not(self._device.get_property(PROPERTY_TO_DPS_ID[ATTR_DISPLAY_OFF]))
+        return not (self._device.get_property(PROPERTY_TO_DPS_ID[ATTR_DISPLAY_OFF]))
 
     async def async_turn_on(self):
-        await self._device.async_set_property(PROPERTY_TO_DPS_ID[ATTR_DISPLAY_OFF], False)
+        await self._device.async_set_property(
+            PROPERTY_TO_DPS_ID[ATTR_DISPLAY_OFF], False
+        )
 
     async def async_turn_off(self):
         await self._device.async_set_property(
@@ -65,7 +67,9 @@ class GoldairDehumidifierLedDisplayLight(LightEntity):
 
     async def async_toggle(self):
         dps_hvac_mode = self._device.get_property(PROPERTY_TO_DPS_ID[ATTR_HVAC_MODE])
-        dps_display_off = self._device.get_property(PROPERTY_TO_DPS_ID[ATTR_DISPLAY_OFF])
+        dps_display_off = self._device.get_property(
+            PROPERTY_TO_DPS_ID[ATTR_DISPLAY_OFF]
+        )
 
         if dps_hvac_mode != HVAC_MODE_TO_DPS_MODE[HVAC_MODE_OFF]:
             await (self.turn_on() if dps_display_off else self.turn_off())

+ 1 - 0
custom_components/tuya_local/kogan_socket/const.py

@@ -2,6 +2,7 @@ from homeassistant.components.switch import (
     ATTR_CURRENT_POWER_W,
     DEVICE_CLASS_OUTLET,
 )
+
 ATTR_SWITCH = "switch"
 ATTR_TIMER = "timer"
 ATTR_CURRENT_A = "current"

+ 3 - 1
custom_components/tuya_local/kogan_socket/switch.py

@@ -67,7 +67,9 @@ class KoganSocketSwitch(SwitchEntity):
     @property
     def current_power_w(self):
         """Return the current power consumption in Watts"""
-        return self._device.get_property(PROPERTY_TO_DPS_ID[ATTR_CURRENT_POWER_W]) / 10.0
+        return (
+            self._device.get_property(PROPERTY_TO_DPS_ID[ATTR_CURRENT_POWER_W]) / 10.0
+        )
 
     @property
     def device_state_attributes(self):