Skip to content

Commit ae92a28

Browse files
committed
NEW: Virtual Components Shelly gen3 support.
Better internet error handling.
1 parent ed0f3d0 commit ae92a28

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SmartHeatingWidthShelly.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ activate heating during the most cost-effective hours each day, employing variou
77
3. Utilization of min-max price levels to maintain the Shelly system consistently on or off.
88
The script executes daily after 23:00 to establish heating timeslots for the following day.
99
10-
created by Leivo Sepp, 16.12.2024
10+
created by Leivo Sepp, 17.12.2024
1111
https://github.com/LeivoSepp/Smart-heating-management-with-Shelly
1212
*/
1313

@@ -316,7 +316,7 @@ function storeSettingsKvs(userCongfigNotInKvs) {
316316
let key = userCongfigNotInKvs.splice(0, 1)[0][0] + _.sId;
317317
cntr++;
318318
Shelly.call("KVS.set", { key: key, value: value },
319-
function (_, error_code, _, data) {
319+
function (res, error_code, error_message, data) {
320320
if (error_code !== 0) {
321321
print(_.pId, "Store settings", data.key, data.value, "in KVS failed.");
322322
} else {
@@ -343,7 +343,7 @@ function deleteAllKvs(userConfig) {
343343
let key = userConfig.splice(0, 1)[0];
344344
cntr++;
345345
Shelly.call("KVS.Delete", { key: key },
346-
function (_, error_code, error_message, data) {
346+
function (res, error_code, error_message, data) {
347347
if (error_code === 0) {
348348
print(_.pId, "Deleted " + data.key + " from KVS store");
349349
} else {
@@ -390,7 +390,7 @@ function deleteVirtualComponents(vComponents) {
390390
let key = vComponents.splice(0, 1)[0].key;
391391
cntr++;
392392
Shelly.call("Virtual.Delete", { key: key },
393-
function (_, error_code, error_message, data) {
393+
function (res, error_code, error_message, data) {
394394
if (error_code === 0) {
395395
print(_.pId, "Deleted " + data.key + " virtual component");
396396
} else {
@@ -420,7 +420,7 @@ function addVirtualComponent(virtualComponents) {
420420
let config = component.config;
421421
cntr++;
422422
Shelly.call("Virtual.Add", { type: type, id: id, config: config },
423-
function (_, error_code, error_message, data) {
423+
function (res, error_code, error_message, data) {
424424
if (error_code === 0) {
425425
print(_.pId, "Added virtual component: " + data.type + ":" + data.id);
426426
} else {

0 commit comments

Comments
 (0)