Updating Python Framework Parameter from the plugin code

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Updating Python Framework Parameter from the plugin code

Post by pipiche »

When using Python Plugin Framework, we have access to a number of Parameters.
Those can be read in the plugin code using Parameters["Mode6"], however the plugin code cannot update the value, or at least it is not written in the DB.
So next time when you come back to the HW Plugin Page you get the initial value.

Would it be possible to have an Update API for the Framework Parameter ? At least for Mode1 to Mode6 ?

Else, if not possible could we have a different type of Parameter, which automatically is reset to its default value.
In other word, I would like to have Mode5 always set to False. If I set it to True , then it is True only for this session, and then it will automatically fall back to False
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Updating Python Framework Parameter from the plugin code

Post by febalci »

why don't you assign a variable to mode5 and change that variable instead of Mode5? I don't really see the advantage of this request since Parameters are Constants in the plugin, not variables. That is the whole logic about it.
pipiche
Posts: 2035
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Re: Updating Python Framework Parameter from the plugin code

Post by pipiche »

because when you restart the plugin you get the Mode5 value ...
Post Reply