iobroker.schlueter-thermostat 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/io-package.json +14 -1
- package/main.js +38 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -222,6 +222,10 @@ Enable **debug log level** to see cloud communication.
|
|
|
222
222
|
Placeholder for the next version (at the beginning of the line):
|
|
223
223
|
### **WORK IN PROGRESS**
|
|
224
224
|
-->
|
|
225
|
+
### 0.2.4 (2026-01-28)
|
|
226
|
+
|
|
227
|
+
- (patricknitsch) Change Format of Times
|
|
228
|
+
|
|
225
229
|
### 0.2.3 (2026-01-28)
|
|
226
230
|
|
|
227
231
|
- (patricknitsch) Catch wrong values for Temperature and Regulation Mode
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "schlueter-thermostat",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.2.4": {
|
|
7
|
+
"en": "Change Format of Times",
|
|
8
|
+
"de": "Format der Zeiten ändern",
|
|
9
|
+
"ru": "Изменение формата времени",
|
|
10
|
+
"pt": "Mudar o Formato dos Tempos",
|
|
11
|
+
"nl": "Formaat van tijden wijzigen",
|
|
12
|
+
"fr": "Modification du format des temps",
|
|
13
|
+
"it": "Cambia il formato dei tempi",
|
|
14
|
+
"es": "Formato de cambio de tiempos",
|
|
15
|
+
"pl": "Zmień format Times",
|
|
16
|
+
"uk": "Змінення форматів часу",
|
|
17
|
+
"zh-cn": "更改时间格式"
|
|
18
|
+
},
|
|
6
19
|
"0.2.3": {
|
|
7
20
|
"en": "Catch wrong values for Temperature and Regulation Mode",
|
|
8
21
|
"de": "Falsche Werte für Temperatur und Regelungsmodus einfangen",
|
package/main.js
CHANGED
|
@@ -630,8 +630,8 @@ class SchlueterThermostat extends utils.Adapter {
|
|
|
630
630
|
this.safeSetState(`${devId}.regulationMode`, { val: mode, ack: true });
|
|
631
631
|
this.safeSetState(`${devId}.regulationModeSet`, { val: mode, ack: true });
|
|
632
632
|
|
|
633
|
-
const comfortEnd =
|
|
634
|
-
const boostEnd =
|
|
633
|
+
const comfortEnd = this._formatIsoNoMsNoZ(t?.ComfortEndTime || '');
|
|
634
|
+
const boostEnd = this._formatIsoNoMsNoZ(t?.BoostEndTime || '');
|
|
635
635
|
if (comfortEnd) {
|
|
636
636
|
this.safeSetState(`${devId}.endTime.comfort`, comfortEnd, true);
|
|
637
637
|
this.safeSetState(`${devId}.endTime.comfortSet`, comfortEnd, true);
|
|
@@ -780,7 +780,7 @@ class SchlueterThermostat extends utils.Adapter {
|
|
|
780
780
|
// ============================================================================
|
|
781
781
|
|
|
782
782
|
_nowPlusMinutesIso(minutes) {
|
|
783
|
-
return new Date(Date.now() + minutes * 60 * 1000)
|
|
783
|
+
return this._formatIsoNoMsNoZ(new Date(Date.now() + minutes * 60 * 1000));
|
|
784
784
|
}
|
|
785
785
|
|
|
786
786
|
_parseIsoOrMinutes(value, defaultMinutes) {
|
|
@@ -794,14 +794,41 @@ class SchlueterThermostat extends utils.Adapter {
|
|
|
794
794
|
return this._nowPlusMinutesIso(asNum);
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
+
// ISO-like string
|
|
797
798
|
const d = new Date(v);
|
|
798
799
|
if (!Number.isNaN(d.getTime())) {
|
|
799
|
-
return
|
|
800
|
+
return this._formatIsoNoMsNoZ(d); // NEW
|
|
800
801
|
}
|
|
801
802
|
|
|
802
803
|
return this._nowPlusMinutesIso(defaultMinutes);
|
|
803
804
|
}
|
|
804
805
|
|
|
806
|
+
_formatIsoNoMsNoZ(value) {
|
|
807
|
+
// Accept Date or string, return "YYYY-MM-DDTHH:mm:ss"
|
|
808
|
+
if (!value) {
|
|
809
|
+
return '';
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
let d;
|
|
813
|
+
if (value instanceof Date) {
|
|
814
|
+
d = value;
|
|
815
|
+
} else {
|
|
816
|
+
d = new Date(String(value));
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
if (Number.isNaN(d.getTime())) {
|
|
820
|
+
// If it already looks like "YYYY-MM-DDTHH:mm:ss(.sss)?Z?" just strip
|
|
821
|
+
return String(value)
|
|
822
|
+
.trim()
|
|
823
|
+
.replace(/\.\d{3}Z$/, '')
|
|
824
|
+
.replace(/Z$/, '')
|
|
825
|
+
.replace(/\.\d{3}$/, '');
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// toISOString() => "YYYY-MM-DDTHH:mm:ss.sssZ"
|
|
829
|
+
return d.toISOString().replace(/\.\d{3}Z$/, '');
|
|
830
|
+
}
|
|
831
|
+
|
|
805
832
|
async _getSerialFromObject(groupId, thermostatId) {
|
|
806
833
|
const oid = `groups.${safeId(groupId)}.thermostats.${safeId(thermostatId)}`;
|
|
807
834
|
const obj = await this.safeGetObject(oid);
|
|
@@ -848,8 +875,13 @@ class SchlueterThermostat extends utils.Adapter {
|
|
|
848
875
|
|
|
849
876
|
const thermostatName = this.thermostatNameCache[thermostatId] || `Thermostat ${thermostatId}`;
|
|
850
877
|
|
|
851
|
-
const comfortEndTime = this.
|
|
852
|
-
|
|
878
|
+
const comfortEndTime = this._formatIsoNoMsNoZ(
|
|
879
|
+
this.thermostatComfortEnd[thermostatId] || this._nowPlusMinutesIso(120),
|
|
880
|
+
);
|
|
881
|
+
|
|
882
|
+
const boostEndTime = this._formatIsoNoMsNoZ(
|
|
883
|
+
this.thermostatBoostEnd[thermostatId] || this._nowPlusMinutesIso(60),
|
|
884
|
+
);
|
|
853
885
|
|
|
854
886
|
const baseUpdate = {
|
|
855
887
|
ThermostatName: thermostatName,
|