Cleanup async handling (#6388)
* Cleanups unneeded blocks * Cleanup bootstrap * dedicated update_ha_state * Fix imap_email_content * fx tests * Fix lint & spell
This commit is contained in:
1 parent
3044aecbe9
commit
8232f1ef65
30 files changed
+124
-108
No files matched your search
@@ -106,4 +106,4 @@ class EnOceanLight(enocean.EnOceanDevice, Light):
|
||||
"""Update the internal state of this device."""
|
||||
self._brightness = math.floor(val / 100.0 * 256.0)
|
||||
self._on_state = bool(val != 0)
|
||||
self.update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
@@ -98,7 +98,7 @@ class LIFX(object):
|
||||
ipaddr, name, power, hue, sat, bri, kel)
|
||||
bulb.set_power(power)
|
||||
bulb.set_color(hue, sat, bri, kel)
|
||||
bulb.update_ha_state()
|
||||
bulb.schedule_update_ha_state()
|
||||
|
||||
def on_color(self, ipaddr, hue, sat, bri, kel):
|
||||
"""Initialize the light."""
|
||||
@@ -106,7 +106,7 @@ class LIFX(object):
|
||||
|
||||
if bulb is not None:
|
||||
bulb.set_color(hue, sat, bri, kel)
|
||||
bulb.update_ha_state()
|
||||
bulb.schedule_update_ha_state()
|
||||
|
||||
def on_power(self, ipaddr, power):
|
||||
"""Initialize the light."""
|
||||
@@ -114,7 +114,7 @@ class LIFX(object):
|
||||
|
||||
if bulb is not None:
|
||||
bulb.set_power(power)
|
||||
bulb.update_ha_state()
|
||||
bulb.schedule_update_ha_state()
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def poll(self, now):
|
||||
|
||||
@@ -106,7 +106,7 @@ class SCSGateLight(Light):
|
||||
return
|
||||
|
||||
self._toggled = message.toggled
|
||||
self.update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
command = "off"
|
||||
if self._toggled:
|
||||
|
||||
Reference in new issue
Block a user