Comments (3)
https://deploy-preview-2171--developers-home-assistant.netlify.app/docs/asyncio_thread_safety#ensuring-code-is-run-in-the-correct-thread might be helpful as well
Final version at https://developers.home-assistant.io/docs/asyncio_thread_safety
from tuya-local.
You may want to consider switching to entry.async_create_background_task
That is something I have considered recently, but the code is called from the async_added_to_hass
callback, which does not get passed the entry. Is there are generic way to get the entry when you are not in the async_setup_entry
phase of setup?
from tuya-local.
You'll have the pass the config entry to the entity when you create the object.
You can still use hass.async_create_background_task
https://github.com/home-assistant/core/blob/2590db1b6dc253e4d80b3fada5b051512be1b21a/homeassistant/core.py#L843 in the mean time if you don't want to refactor. If you use that one instead of entry.async_create_background_task
, you'll need make sure the task is cancelled yourself when the entry is unloaded or the entity is removed.
from tuya-local.
Related Issues (20)
- ZY-M100-WIFI24G - not recognized as ZY-M100 in tuya local HOT 8
- Cannot add second PIR sensor through Zigbee GW HOT 1
- Consider replacing `start` code with Home Assistant built-in `async_at_started` helper HOT 1
- Detection of Lefant M213S fails
- Use entry.async_create_background_task to get HA to manage the task lifecycle HOT 1
- Request support for [Sirena Outdoor Strobe Siren WS-902 Plus(Wi-Fi)] HOT 3
- Request feature support for setting door lock password
- Aquatech Heat pump HOT 7
- Symbolic link loop HOT 1
- Request support for PLD_DS01 - Tuya Bluetooth Smart Lock HOT 3
- Request support for Diivoo DWV010 HOT 2
- issue adding BEOK thermostat TOL47 - wrong device profile mapping HOT 2
- Add open support to lock entity
- Request support for WVC Micro Inverter HOT 1
- Request support for Daitsu DS-9KTP Air Conditioner
- Request support for [Tongou QCB2-WB Wi-Fi ST]
- Request support for [Tongou SMR1-WiFi Smart RCBO]
- Request support for Tesla Air Purifier S300
- Reload Config Entry Makes device unavailable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuya-local.