Driver 'Save Device' Hook

Anyone know if a method exists which is called when the Save Device button is pressed for a driver? Similar to how updated() is called when 'Save Preferences' is pressed.


No, there is not. The driver is being assigned when you do that so there is no method to run yet since the driver is just being loaded. And which driver would it pick the method from? The old one or the new one?

There is an event "installed" I believe. What are you trying to do?

Installed is only called when the device is created. I just tried doing this exact thing and none of the standard method, updated, installed, initialize are called. At least I can't see anything being called.

The screenshot I posted was a bit misleading. It was actually taken from the device settings, not from the screen presented when creating a virtual device (having since checked, I now realise they're identical.)

Essentially, I was wondering if a method exists which is called when the 'Save Device' button is pressed in an existing device's settings - see screenshot. I suspect it doesn't exist, but asking the question nonetheless.

I want to use device.getDisplayName() to publish to an external source if and when the device name/label is modified. method is called when that button is pushed.

How time sensitive is a device name? I wouldn't think time sensitive at all. You can schedule something to run once a day to check if it's changed from a previous saved value (you can put it in state).

That's exactly what I'm currently doing with a scheduled refresh task. Was just hoping I could simplify if a method existed. Cheers