999LV / SmartVirtualThermostat

Smart Virtual Thermostat python plugin for Domoticz home automation system
MIT License
42 stars 31 forks source link

Changed API from 'saveuservariable' to 'adduservariable'. #18

Closed informagico closed 5 years ago

informagico commented 5 years ago

API 'saveuservariable' seems to be no longer working on latest beta. A "status = ERR" is given while using that API (also calling it directly), instead is working with 'adduservariable' (the same used by jquery on web app).

Tested on 4.10301 beta.

999LV commented 5 years ago

Many thanks. I had not spotted the changes made to the domoticz API since version 4.10298.

Unfortunately this is a breaking change, so this fix will not work on prior domoticz versions. The plugin code must include a check for the host version and adjust the API call accordingly.

I can work on this after the Christmas break, but please feel free to submit an updated pull request including this version test if you can.

informagico commented 5 years ago

Oh, didn't tought about that, my bad. I've fixed it with last commit.

999LV commented 5 years ago

Many thanks....

May be better to move the version check into the getuservariable function (no need to make the API call upon each start but only if the user variable does not exist) ?

can you bump the minor version number as well, if I am not asking too much :)

informagico commented 5 years ago

I'm glad to collaborate :) I've made another commit, check if it's ok to you

999LV commented 5 years ago

Many thanks