Skip to content

Commit

Permalink
HA 2024.5 workaround attempt 2
Browse files Browse the repository at this point in the history
Revert previous ineffective workaround, instead opt out of importing
on executor.

The original issue seems to have been caused by changes in HA 2024.4
to initialise integrations on an executor thread instead of in the
event loop.  So when the receive thread is created, it is not being
created from the event loop, and later gets killed along with the
startup cleanup (which we previously carefully avoided).

Opt out of this change for now until it is clearer how to adapt to
the new HA architecture changes.

Issue #1871, #1872
  • Loading branch information
make-all committed May 2, 2024
1 parent 4a05f5e commit 81e0071
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/tuya_local/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ async def receive_loop(self):
for dp in entity._config.dps():
if not dp.persist and dp.id not in poll:
self._cached_state.pop(dp.id, None)
entity.schedule_update_ha_state()
entity.async_write_ha_state()
else:
_LOGGER.debug(
"%s received non data %s",
Expand Down
3 changes: 2 additions & 1 deletion custom_components/tuya_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/make-all/tuya-local/issues",
"requirements": ["tinytuya==1.13.2"],
"version": "2024.5.0"
"version": "2024.5.1",
"import_executor": false
}

0 comments on commit 81e0071

Please sign in to comment.