Changing Unit's option in python plugin

Python and python framework

Moderator: leecollings

Post Reply
ajarzyn
Posts: 9
Joined: Tuesday 13 October 2020 23:04
Target OS: -
Domoticz version:
Contact:

Changing Unit's option in python plugin

Post by ajarzyn »

Hello all,

I found out there's new interface for Units for python plugin development.
Does anyone knows if it's possible to change Units option, and how?

As new documentation states Options member is read only:

Code: Select all

Options 	Read 	Current Device options dictionary
Thus I do not know if it's possible at all.

But as there is 'Update' method I understand that it's possible to change TypeName of the device thus I feel like we should be able to change options value.

Please note that I do not want to delate Unit and create it from the scratch, rather updating existing unit to keep the history of changes.

I would really appreciate any help here.
BR
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Changing Unit's option in python plugin

Post by Dnpwwo »

@ajarzyn,

You can change the Options just not the dictionary itself.

If you add, update or remove the Options dictionary entires then invoke Update() the Options for the Unit will be updated.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest