diff --git a/Scripts/Shelly-Rank-and-Price.js b/Scripts/Shelly-Rank-and-Price.js index 32ea588..9c42827 100644 --- a/Scripts/Shelly-Rank-and-Price.js +++ b/Scripts/Shelly-Rank-and-Price.js @@ -1,5 +1,5 @@ // Thank you for your support: https://www.buymeacoffee.com/spothintafi -// Supported Shelly firmwares: 1.0.3 - 1.2.3. Script version: 2024-03-03 +// Supported Shelly firmwares: 1.0.3 - 1.2.3. Script version: 2024-03-17 // Region to use let Region = "FI"; // Supported regions: DK1, DK2, EE, FI, LT, LV, NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4 @@ -99,7 +99,7 @@ function SetRelayStatusInShellyBasedOnHttpStatus(response, error_code, error_msg if (response.code === 200) { SetRelayStatusInShelly(Settings, Settings.InvertedOn); return true; } if (response.code === 400) { SetRelayStatusInShelly(Settings, Settings.InvertedOff); return true; } } - if (Settings.BackupHours.indexOf(cHour) > -1) { SetRelayStatusInShelly(Settings, Settings.InvertedOn); return false; } + if (Settings.BackupHours.indexOf(currentHour) > -1) { SetRelayStatusInShelly(Settings, Settings.InvertedOn); return false; } else { SetRelayStatusInShelly(Settings, Settings.InvertedOff); return false; } }