Improve async/multithreaded behavior of tellstick code (#4989)
* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity. * Refactor Tellstick object model for increased clarity. * Update comments. Unify better with sensors. Fix typo bug. Add debug logging. * Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity. * Refactor Tellstick object model for increased clarity. * Update comments. Unify better with sensors. Fix typo bug. Add debug logging. * Fix lint issues. * Remove global variable according to hint from balloob. * Better async/threading behavior for tellstick. * Fix lint/style checks. * Use hass.async_add_job
This commit is contained in:
1 parent
2a7a419ff3
commit
d9614cff46
3 files changed
+77
-44
No files matched your search
@@ -46,9 +46,9 @@ class TellstickSwitch(TellstickDevice, ToggleEntity):
|
||||
"""Update the device entity state to match the arguments."""
|
||||
self._state = new_state
|
||||
|
||||
def _send_tellstick_command(self):
|
||||
"""Let tellcore update the device to match the current state."""
|
||||
if self._state:
|
||||
def _send_device_command(self, requested_state, requested_data):
|
||||
"""Let tellcore update the actual device to the requested state."""
|
||||
if requested_state:
|
||||
self._tellcore_device.turn_on()
|
||||
else:
|
||||
self._tellcore_device.turn_off()
|
||||
|
||||
Reference in new issue
Block a user