What is the 'official' way to do asynchronous calls in the python plugin framework?
For example, I'm getting data form bluetooth low energy devices. That takes a while, and there could be a communication time-out. In order to not hang the entire system, I created a second python script that does the unpredictable work. That worked for the 433 RF Switches plugin (which resords and breadcasts RF signals). I also tried doing this for a new plugin for Mi Flower Mate sensors which work over Bluetooth LE. But there I ran into an error.
Ideally each python plugin would run as its own asynchronous proces. I'm curious: why doesn't it work like that?
And more practical: are there other ways to do this that are recommended? Spawn a new python thread perhaps?
Python Plugin: best way to do asynchronous work?
Moderator: leecollings
-
- Posts: 331
- Joined: Wednesday 21 December 2016 9:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: current
- Contact:
Who is online
Users browsing this forum: No registered users and 1 guest