Page 1 of 1

Change SwitchType in extended plugin framework

Posted: Friday 10 May 2024 12:04
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.

Re: Change SwitchType in extended plugin framework

Posted: Friday 10 May 2024 16:26
by Barberousse
I created a PR to add On/Off and Fan TypeName:

https://github.com/domoticz/domoticz/pull/6078

Re: Change SwitchType in extended plugin framework

Posted: Saturday 11 May 2024 15:30
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