How to know if hardware is removed (not stopped)

Python and python framework

Moderator: leecollings

Post Reply
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

How to know if hardware is removed (not stopped)

Post by zak45 »

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: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

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

Post by Dnpwwo »

@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: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

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

Post by zak45 »

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 1 guest