Python plugin error handling

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Python plugin error handling

Post by pipiche »

I'm wondering how we can make the python plugin in a stop mode.

For instance as part of error handling sometime we should stop/pause the plugin. What is the best to do it ?
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin error handling

Post by pipiche »

@dnpwoo is there any API you would consider adding into the plugin, in order to stop properly and exit ?
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python plugin error handling

Post by Dnpwwo »

@pipche,

It should be trivial to add a 'Domoticz.Stop()' API because, like everything else, stopping is just an event (a StopDirective' from memory) that should tidy up any connections, call onStop and then stop the thread.

Once it is stopped though the plugin can't restart itself though.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin error handling

Post by pipiche »

I think this make sense and would be useful.

And agree when the plugin is stopped, no way to restart except from Domoticz Hardware


Envoyé de mon iPhone en utilisant Tapatalk
Post Reply