Page 1 of 1

Switching non-switchable devices

Posted: Fri Mar 25, 2011 5:26 pm
by wwolkers
Via the XML-RPC api it's possible to switch on and off devices, which are not enabled for switching.

if I do a device.listswitch I get a list of devices which are switchable, that works ok.

example:
Vaatwasser On
Mechanische Ventilatie On
Lampjes buffetkast Off

If I try switching one of these with device.setdevice, no problem also.

but I am also able to do a device.setdevice on any of my other devices, even though they are not in the list of switchable devices.

I'm assuming this is not intentional?
Should I see if I can fix up a patch for this one?

W.

Re: Switching non-switchable devices

Posted: Fri Mar 25, 2011 9:51 pm
by RDNZL
We should create a sub Devices.DeviceIsControlable() returning boolean TRUE if a device is switchable or dimable,
and call that early in Devices.SetDevice, return with FALSE if they aren't dim/switchable, let Devices.Setdevice() return FALSE too in that case so XMLRPC knows it failed.