Change SwitchType in extended plugin framework

Python and python framework

Moderator: leecollings

Post Reply
Barberousse
Posts: 140
Joined: Wednesday 02 December 2015 21:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Change SwitchType in extended plugin framework

Post by Barberousse »

Hello,

How do you revert to on/off switch with extended plugin framework? The Update() method of Unit object allow only TypeName (not Type / SubType / SwitchType) as parameter to change a switch type. If I create a switch as "Contact" TypeName, it seems that I cannot come back to standard on/off switch with Update(TypeName="Switch") because in Domoticz maptypename function (https://github.com/domoticz/domoticz/bl ... s.cpp#L375), SwitchType is not enforced when TypeName == "Switch" and Update() method from Python doesn't allow to set SwitchType.

Thank you for your suggestions.
Barberousse
Posts: 140
Joined: Wednesday 02 December 2015 21:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Change SwitchType in extended plugin framework

Post by Barberousse »

I created a PR to add On/Off and Fan TypeName:

https://github.com/domoticz/domoticz/pull/6078
Barberousse
Posts: 140
Joined: Wednesday 02 December 2015 21:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Change SwitchType in extended plugin framework

Post by Barberousse »

And I created a PR to be able to change by type/subtype/switchtype like normal plugin framework

https://github.com/domoticz/domoticz/pull/6079
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest