Remove unneeded context switch in dyson (#41793)

dyson was running the add_message_listener code in the
executor even though all it did was append to an array

https://github.com/etheralm/libpurecool/blob/master/libpurecool/dyson_device.py#L213
This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-10-13 15:45:00 -05:00
1 parent 5c540dcfcf
commit ff2872e376
5 files changed
+7 -15

No files matched your search

+1 -3
View File
@@ -74,9 +74,7 @@ class DysonSensor(Entity):
async def async_added_to_hass(self):
"""Call when entity is added to hass."""
self.hass.async_add_executor_job(
self._device.add_message_listener, self.on_message
)
self._device.add_message_listener(self.on_message)
def on_message(self, message):
"""Handle new messages which are received from the fan."""