A lot of devices can show their battery level. It would be nice to have a plugin to check them all and send a notification.
I’m willing to create this plugin, but does someone know how to get alle device (battery) attributes ?
Battery plugin
A lot of devices can show their battery level. It would be nice to have a plugin to check them all and send a notification.
I’m willing to create this plugin, but does someone know how to get alle device (battery) attributes ?
Haha, that funny, because I had the same idea but realized by a shell script. My idea was to read in all relevant battery level from the api. For sure each battery powered device need to be added by hand, but that’s not a big deal.
With a plugin it would be only variable expression for example like it has to be done in a VariableDevice. For an automatic discovery it should be sufficient to search for “battery” throw the config.
Due to my less knowledge about coffee I’m not able to realize it with a plugin.
I think you could ask the DeviceManager to get all devices that provide a specific method.
Thats an example for getting all devices that provide a sendCommand method:
# Get all devices which have a send method
sendDevices = _(@framework.deviceManager.devices).values().filter(
(device) => device.hasAction('sendCommand')
).value()