How to check if a device is enable?

I use the AbstractTagDriver to create a driver.
I’d like to check and be notified when a device is enable/disable ?

Your driver never gets instantiated if it’s disabled, so… if you’ve “alive” and running code you’re enabled.

In fact, when my device is enable, few thread are launched to manage some communications,
I wan’t to stop these thread if the device is later disable. (“Edit device checkbox enable” unchechecked by user).

You’ll have to manage some kind of global counter then.

Increment it each time an instance of your driver is instantiated, decrement it each time an instance has shutdown() called on it.

EDIT: Or maybe I’ve misunderstood you and these threads are started by each driver instance (and not globally, by the hook for example), in which case you just need to stop them in shutdown().

Thanks Kevin :thumb_left:
I will stop thread for the device management in the shutdow method.