Sharing an object across devices of one driver

Is there a way to share an object (table) across devices of a given driver? A driver level storage of some kind that is persistent?

I know there is a device:set_field and get_field - is there something similar for driver as well?

@nayelyz 10 chars

Hi, @schwark!
What kind of information would you share in that object? I can think of global variables, but it depends on how you want to handle it.

What isn’t persisted is the information among drivers. If we change the driver that handles the device, the persistent data is removed.

A Shade Controller that has data about all the shades - so one refresh can really update the state of all the shade devices - really what I need is similar to what existed in groovy. The device driver can create a number of “child devices” that it can manage together. The number of shades is dynamic and needs to be discovered and created - this I can do. However, handling updates, where at the very least I need a get_device_by_networkid() call or some way to store all the devices I created in discovery at a driver level so I can create my own get_device() call to update status when any device calls refresh().

You can get the driver’s devices with:

local device_list = driver:get_devices()