How to know if hardware is removed (not stopped)

Python and python framework
Post Reply
zak45
Posts: 481
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.9056
Contact:

How to know if hardware is removed (not stopped)

Post by zak45 » Sunday 13 May 2018 12:53

Hi,

I need to know if hardware is removed by Domoticz. This will help me to do some clean up.
Have take a look on : onStop Called when the hardware is stopped or deleted from Domoticz.
and also on : onDeviceRemoved.

But I do not have been able to catch hardware removing ??

thanks

User avatar
Dnpwwo
Posts: 705
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: How to know if hardware is removed (not stopped)

Post by Dnpwwo » Sunday 13 May 2018 23:47

@zak45,

Not sure how we could do what you are asking for.

None of the hardware in Domoticz is notified when it is deleted and I'm not sure it could be. What if the hardware isn't enabled? Should Domoticz restart it to notify it that it is being deleted?
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

zak45
Posts: 481
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.9056
Contact:

Re: How to know if hardware is removed (not stopped)

Post by zak45 » Monday 14 May 2018 12:31

Dnpwwo wrote:
Sunday 13 May 2018 23:47
@zak45,

Not sure how we could do what you are asking for.

None of the hardware in Domoticz is notified when it is deleted and I'm not sure it could be. What if the hardware isn't enabled? Should Domoticz restart it to notify it that it is being deleted?
Thanks Dnpwwo.
I devlop a plugin that create some files, uservariables.
Goal is to do some clean up only if the Hardware is removed, in all other case, nothing.
Have tried with the OnDeviceRemoved but no luck.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests