iobroker.senec 1.4.0 → 1.4.1

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 CHANGED
@@ -366,6 +366,9 @@ This channel contains calculated values. Currently these are day/week/month/year
366
366
  *Read-only number, which designates the number of wallbox [0..3]. This is only available on systems with configured wallboxes.*
367
367
 
368
368
  ## Changelog
369
+ ### 1.4.1 (NoBl)
370
+ * Fix: Autarky calculations are working again.
371
+
369
372
  ### 1.4.0 (NoBl)
370
373
  * Added object caching along with some minor code updates. Due to the amount of objects we deal with caching is about mandatory.
371
374
 
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "senec",
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "news": {
6
+ "1.4.1": {
7
+ "en": "Autarky calculations are working again.",
8
+ "de": "Autarkieberechnungen funktionieren wieder.",
9
+ "ru": "Расчеты Autarky снова работают.",
10
+ "pt": "Cálculos autarcos estão a funcionar outra vez.",
11
+ "nl": "Autarische berekeningen werken weer.",
12
+ "fr": "Les calculs Autarky fonctionnent à nouveau.",
13
+ "it": "I calcoli autarky funzionano di nuovo.",
14
+ "es": "Los cálculos autárquicos están funcionando de nuevo.",
15
+ "pl": "Ponowne obliczenia autarktyczne działają ponownie.",
16
+ "uk": "Аутарки знову працюють.",
17
+ "zh-cn": "Autarky的计算正再次工作。."
18
+ },
6
19
  "1.4.0": {
7
20
  "en": "Added object caching and minor code updates. Due to the amount of objects we deal with caching is about mandatory.",
8
21
  "de": "Objekt-Caching und kleinere Code-Updates hinzugefügt. Aufgrund der Menge an Objekten, die der Adapter bearbeitet, ist Caching zwingend notwendig.",
@@ -61,17 +74,17 @@
61
74
  "zh-cn": "塞内克"
62
75
  },
63
76
  "desc": {
64
- "en": "This adapter reads available values from a Senec Home V2.1 system using lala.cgi",
65
- "de": "Dieser Adapter liest verfügbare Werte von einem Senec Home V2.1 System mit lala.cgi",
66
- "ru": "Этот адаптер читает доступные значения от системы Senec Home V2.1 с использованием lala.cgi",
67
- "pt": "Este adaptador lê valores disponíveis de um sistema Senec Home V2.1 usando lala.cgi",
68
- "nl": "Deze adapter leest beschikbare waarden van een Senec Home V2.1 systeem met lala",
69
- "fr": "Cet adaptateur lit les valeurs disponibles d'un système Senec Home V2.1 en utilisant lala.cgi",
70
- "it": "Questo adattatore legge i valori disponibili da un sistema Senec Home V2.1 utilizzando lala.cgi",
71
- "es": "Este adaptador lee los valores disponibles de un sistema Senec Home V2.1 utilizando lala.cgi",
72
- "pl": "Ten adapter odczytuje dostępne wartości z systemu Senec Home V2.1 używając lala.cgi",
73
- "uk": "Цей адаптер читає доступні значення з системи Senec Home V2.1 за допомогою lala.cgi",
74
- "zh-cn": "这种适应者用Fla.cgi改为Senec Home V2.1系统可得到的数值。"
77
+ "en": "This adapter reads available values from a Senec Home V2.1 (and later) system using lala.cgi",
78
+ "de": "Dieser Adapter liest verfügbare Werte von einem Senec Home V2.1 (und später) System mit lala.cgi",
79
+ "ru": "Этот адаптер считывает доступные значения от системы Senec Home V2.1 (и позже) с помощью lala.cgi",
80
+ "pt": "Este adaptador lê valores disponíveis de um sistema Senec Home V2.1 (e posterior) usando lala.cgi",
81
+ "nl": "Deze adapter leest beschikbare waarden van een Senec Home V21 (en later) systeem met lala",
82
+ "fr": "Cet adaptateur lit les valeurs disponibles d'un système Senec Home V2.1 (et plus tard) utilisant lala.cgi",
83
+ "it": "Questo adattatore legge i valori disponibili da un sistema Senec Home V2.1 (e successivamente) utilizzando lala.cgi",
84
+ "es": "Este adaptador lee los valores disponibles de un sistema Senec Home V2.1 (y más tarde) usando lala.cgi",
85
+ "pl": "Ta adapter przeczytała dostępne wartości z systemu Senec Home V2.1 (a później) używając lala.cgi",
86
+ "uk": "Цей адаптер зчитуває доступні значення від Senec Home V2.1 (і пізніше) системи за допомогою lala.cgi",
87
+ "zh-cn": "这种适应者从Senec Home V2.1(和以后)利用Fla.cgi阅读了可使用的数值。"
75
88
  },
76
89
  "authors": [
77
90
  "NoBl <github@bluemle.org>"
package/main.js CHANGED
@@ -299,6 +299,7 @@ class Senec extends utils.Adapter {
299
299
  val: value,
300
300
  ack: true
301
301
  });
302
+ await this.checkUpdateSelfStat(name);
302
303
  await this.doDecode(name, value);
303
304
  }
304
305
 
@@ -405,7 +406,7 @@ class Senec extends utils.Adapter {
405
406
  this.log.warn("(Calc) Not updating reference value for: " + name.substring(10) + "! Old RefValue (" + valRef + ") >= new RefValue (" + valCur + "). Impossible situation. If this is intentional, please update via admin!");
406
407
  }
407
408
  } else {
408
- this.log.silly("(Calc) Updating " + day +" value for: " + name.substring(10) + ": " + Number((valCur - valRef).toFixed(2)));
409
+ this.log.debug("(Calc) Updating " + day +" value for: " + name.substring(10) + ": " + Number((valCur - valRef).toFixed(2)));
409
410
  // update today's value
410
411
  await this.doState(key + today, Number((valCur - valRef).toFixed(2)), descToday, unitToday, false);
411
412
  }
@@ -455,9 +456,11 @@ class Senec extends utils.Adapter {
455
456
  }
456
457
  // update today's value - but beware of div/0
457
458
  var newVal = 0;
458
- if (valHouseCons > 0) newVal = Number((((valPVGen - valGridExp - valBatCharge + valBatDischarge) / valHouseCons) * 100).toFixed(0));
459
- this.log.silly("(Autarky) Updating Autarky " + day +" value for: " + key + today + ": " + newVal);
460
- if (valHouseCons > 0) await this.doState(key + today, newVal, descToday, unitToday, false);
459
+ if (valHouseCons > 0) {
460
+ newVal = Number((((valPVGen - valGridExp - valBatCharge + valBatDischarge) / valHouseCons) * 100).toFixed(0));
461
+ this.log.debug("(Autarky) Updating Autarky " + day +" value for: " + key + today + ": " + newVal);
462
+ await this.doState(key + today, newVal, descToday, unitToday, false);
463
+ }
461
464
  }
462
465
 
463
466
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.senec",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Senec Home",
5
5
  "author": {
6
6
  "name": "NoBl",
@@ -47,9 +47,9 @@
47
47
  "eslint": "^8.47.0",
48
48
  "mocha": "^10.2.0",
49
49
  "proxyquire": "^2.1.3",
50
- "sinon": "^15.0.4",
50
+ "sinon": "^15.2.0",
51
51
  "sinon-chai": "^3.7.0",
52
- "typescript": "~4.9.5"
52
+ "typescript": "~5.1.6"
53
53
  },
54
54
  "main": "main.js",
55
55
  "files": [