Page 1 of 1

Extended Python Framework Options parameter

Posted: Tuesday 19 December 2023 19:48
by pipiche
In the Domoticz Python Framework, the Options parameters is documented as Read/Write, however when

Doing

Code: Select all

Devices[DeviceID_].Units[Unit_].Options = Options
This trigger an exception
AttributeError: readonly attribute

For exemple when using a Electricity (instant and counter), if we detect that the Energy is provided by the hardware, we want to set options with

Code: Select all

{'EnergyMeterMode': '1'} 

Re: Extended Python Framework Options parameter

Posted: Wednesday 20 December 2023 19:20
by JanJaap
You would normally provide the options during the creation of the unit. Does that not work for you or do you need to modify it after creation?

The documentation indeed suggests you can update it after creation, so either documentation or implementation would need updating ;)

Re: Extended Python Framework Options parameter

Posted: Wednesday 20 December 2023 19:35
by waltervl

Re: Extended Python Framework Options parameter

Posted: Wednesday 20 December 2023 19:39
by pipiche
JanJaap wrote: Wednesday 20 December 2023 19:20 You would normally provide the options during the creation of the unit. Does that not work for you or do you need to modify it after creation?

The documentation indeed suggests you can update it after creation, so either documentation or implementation would need updating ;)
Yes and no, because in Zigbee the plugin that we have discover the Device functionality. And during the discovery, the device can expose the Metering functionality, however it is only after a short while that we will get or not the summation .

This is why we create the Device at the discovery time set by default 'Computer' and as soon as we receive a summation we update the Options