mirror of
https://github.com/elisspace/core.git
synced 2026-10-05 16:56:19 +00:00
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:
committed by
Paulus Schoutsen
parent
3044aecbe9
commit
8232f1ef65
@@ -188,13 +188,13 @@ class BroadlinkRMSwitch(SwitchDevice):
|
||||
"""Turn the device on."""
|
||||
if self._sendpacket(self._command_on):
|
||||
self._state = True
|
||||
self.update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
"""Turn the device off."""
|
||||
if self._sendpacket(self._command_off):
|
||||
self._state = False
|
||||
self.update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def _sendpacket(self, packet, retry=2):
|
||||
"""Send packet to device."""
|
||||
|
||||
@@ -114,10 +114,10 @@ class RPiRFSwitch(SwitchDevice):
|
||||
"""Turn the switch on."""
|
||||
if self._send_code(self._code_on, self._protocol, self._pulselength):
|
||||
self._state = True
|
||||
self.update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def turn_off(self):
|
||||
"""Turn the switch off."""
|
||||
if self._send_code(self._code_off, self._protocol, self._pulselength):
|
||||
self._state = False
|
||||
self.update_ha_state()
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@@ -141,7 +141,7 @@ class SCSGateSwitch(SwitchDevice):
|
||||
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