From 89d377c85d158d696ca997e661c21ce5092b135e Mon Sep 17 00:00:00 2001 From: lokonli Date: Tue, 6 Jun 2023 20:35:55 +0200 Subject: [PATCH] Domoticz API fix changes --- docs/releasenotes/releasenotes.rst | 8 ++++++++ js/components/graph.js | 14 ++++++++------ js/domoticz-api.js | 16 +++++++++------- js/loader.js | 2 +- js/version.js | 4 ++-- version.txt | 5 +++-- 6 files changed, 31 insertions(+), 18 deletions(-) diff --git a/docs/releasenotes/releasenotes.rst b/docs/releasenotes/releasenotes.rst index 70fa0086..b3f42c94 100644 --- a/docs/releasenotes/releasenotes.rst +++ b/docs/releasenotes/releasenotes.rst @@ -8,6 +8,14 @@ For Dashticz's **master** version Release Notes go to: https://dashticz.readthed Recent changes --------------- +v3.10.5 Beta (6-6-2023) +------------------------- + +Fixes +~~~~~ + +* Fix for additional changes in Domoticz API (2023.1, build 15327 and up) + v3.10.4 Beta (4-6-2023) ------------------------- diff --git a/js/components/graph.js b/js/components/graph.js index 3c54b0bf..01b1f24d 100644 --- a/js/components/graph.js +++ b/js/components/graph.js @@ -169,7 +169,7 @@ function getDeviceDefaults(me, device) { case 'Wind': sensor = 'wind'; var windspeed = device.Data.split(';')[2] / 10; - if (config['use_beaufort']) { + if (settings['use_beaufort']) { currentValue = Beaufort(windspeed); decimals = 0; txtUnit = 'Bft'; @@ -491,7 +491,7 @@ function getAllGraphData(me) { function getRegularGraphData(me, i) { var device = me.graphDevices[i]; - var cmd = domoVersion.newGraphApi ? 'type=command¶m=graph' : 'type=graph'; + var cmd = domoVersion.api15330 ? 'type=command¶m=graph' : 'type=graph'; var params = cmd + '&sensor=' + device.sensor + @@ -509,7 +509,7 @@ function getSwitchGraphData(me, i) { var device = me.graphDevices[i]; //http://:8080/json.htm?idx=19&type=lightlog //todo: check type=command¶m=graph for new Domoticz version>=15330 - var cmd = domoVersion.newGraphApi ? 'param=getlightlog&type=command' : 'type=lightlog'; + var cmd = domoVersion.api15330 ? 'param=getlightlog&type=command' : 'type=lightlog'; var params = cmd + '&idx=' + device.idx; me.params[i] = params; return Domoticz.request(params).then(function (data) { @@ -1501,7 +1501,7 @@ function showData(graph) { html += '