Skip to content

Commit

Permalink
chore: release v1.15.12
Browse files Browse the repository at this point in the history
* (foxriver76) we now adjust min/max correct if a `SPECIAL` value falls out of range (closes #459)
  • Loading branch information
foxriver76 committed Mar 19, 2022
1 parent c248ca6 commit f8b7162
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 30 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ via or/and operator. The then clause of the program can remain empty. Now your s
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__
-->
### 1.15.12 (2022-03-19)
* (foxriver76) we now adjust min/max correct if a `SPECIAL` value falls out of range (closes #459)

### 1.15.11 (2022-03-18)
* (foxriver76) fallback to old adapter port determination logic (closes #509)

Expand Down
31 changes: 24 additions & 7 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/main.js.map

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@
"pl": "Łączy procesy HomeMatic-Interface (BidCos-Services, Homegear i CUxD) za pośrednictwem XML-RPC lub BIN-RPC z ioBroker",
"zh-cn": "通过 XML-RPC 或 BIN-RPC 将 HomeMatic 接口进程(BidCos-Services、Homegear 和 CUxD)连接到 ioBroker"
},
"version": "1.15.11",
"version": "1.15.12",
"news": {
"1.15.12": {
"en": "we now adjust min/max correct if a `SPECIAL` value falls out of range (closes #459)",
"de": "Wir passen Min/Max jetzt korrekt an, wenn ein „SPECIAL“-Wert außerhalb des Bereichs liegt (schließt #459)",
"ru": "теперь мы правильно настраиваем min/max, если значение SPECIAL выходит за пределы допустимого диапазона (закрывается #459)",
"pt": "agora ajustamos o mínimo/máximo correto se um valor 'SPECIAL' estiver fora do intervalo (fecha #459)",
"nl": "we passen nu min/max correct aan als een `SPECIAL`-waarde buiten bereik valt (sluit #459)",
"fr": "nous ajustons maintenant min/max correctement si une valeur `SPECIAL` tombe hors de la plage (ferme #459)",
"it": "ora regoliamo min/max corretto se un valore `SPECIAL` non rientra nell'intervallo (chiude #459)",
"es": "ahora ajustamos min/max correcto si un valor 'ESPECIAL' cae fuera de rango (cierra #459)",
"pl": "teraz dostosowujemy minimalną/maksymalną wartość, jeśli wartość `SPECIAL` wykracza poza zakres (zamyka #459)",
"zh-cn": "如果“特殊”值超出范围,我们现在调整最小/最大值正确(关闭 #459)"
},
"1.15.11": {
"en": "fallback to old adapter port determination logic (closes #509)",
"de": "Fallback auf alte Adapter-Port-Ermittlungslogik (schließt #509)",
Expand Down Expand Up @@ -87,18 +99,6 @@
"es": "solución implementada para el error RSSI_DEVICE 128 si los dispositivos se conectan a HMIP-HAP (correcciones #346, #469, #402)",
"pl": "zaimplementowane obejście błędu RSSI_DEVICE 128, jeśli urządzenia łączą się z HMIP-HAP (poprawki #346, #469, #402)",
"zh-cn": "如果设备连接到 HMIP-HAP,则针对 RSSI_DEVICE 128 错误实施解决方法(修复 #346、#469、#402)"
},
"1.15.5": {
"en": "added handler for `readdedDevice` event (closes #356)\nadded error handling on rpc server (fixes #457)\nadded icon of HmIP-eTRV-E-S (closes #456)",
"de": "Handler für `readdedDevice`-Ereignis hinzugefügt (schließt #356)\nFehlerbehandlung auf dem RPC-Server hinzugefügt (Korrekturen Nr. 457)\nIcon von HmIP-eTRV-E-S hinzugefügt (schließt #456)",
"ru": "добавлен обработчик события `readdedDevice` (закрывается #356)\nдобавлена обработка ошибок на rpc-сервере (исправлено № 457)\nдобавлена иконка HmIP-eTRV-E-S (закрывается #456)",
"pt": "adicionado manipulador para o evento `readdedDevice` (fecha #356)\nadicionado tratamento de erros no servidor rpc (correções #457)\nadicionado ícone de HmIP-eTRV-E-S (fecha #456)",
"nl": "toegevoegde handler voor gebeurtenis `readdedDevice` (sluit #356 af)\nfoutafhandeling toegevoegd op rpc-server (fixes #457)\ntoegevoegd icoon van HmIP-eTRV-E-S (sluit #456)",
"fr": "ajout d'un gestionnaire pour l'événement `readdedDevice` (ferme #356)\najout de la gestion des erreurs sur le serveur rpc (corrections #457)\nicône ajoutée de HmIP-eTRV-E-S (ferme #456)",
"it": "aggiunto gestore per l'evento `readdedDevice` (chiude #356)\naggiunta la gestione degli errori sul server rpc (correzioni n. 457)\naggiunta icona di HmIP-eTRV-E-S (chiude #456)",
"es": "controlador agregado para el evento `readdedDevice` (cierra #356)\nmanejo de errores agregado en el servidor rpc (correcciones # 457)\nícono agregado de HmIP-eTRV-E-S (cierra #456)",
"pl": "dodano obsługę zdarzenia `readdedDevice` (zamyka #356)\ndodano obsługę błędów na serwerze RPC (poprawki #457)\ndodana ikona HmIP-eTRV-E-S (zamyka #456)",
"zh-cn": "为 `readedDevice` 事件添加了处理程序(关闭 #356)\n在 rpc 服务器上添加了错误处理(修复 #457)\n添加了 HmIP-eTRV-E-S 的图标(关闭 #456)"
}
},
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.hm-rpc",
"version": "1.15.11",
"version": "1.15.12",
"description": "Connects HomeMatic Interface-Processes (BidCos-Services, Homegear and CUxD) via XML-RPC or BIN-RPC to ioBroker",
"author": {
"name": "hobbyquaker",
Expand Down
39 changes: 32 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,12 +1465,7 @@ async function addParamsetObjects(
} // endIf

if (paramObj.SPECIAL) {
if (typeof obj.common.states !== 'object' || Array.isArray(obj.common.states)) {
obj.common.states = {};
}
for (let i = 0; i < paramObj.SPECIAL.length; i++) {
obj.common.states[paramObj.SPECIAL[i].VALUE] = paramObj.SPECIAL[i].ID;
}
addCommonSpecial(paramObj, obj);
} // endIf
} // endIf

Expand Down Expand Up @@ -1567,7 +1562,7 @@ async function addParamsetObjects(
TYPE: paramObj.TYPE
};

if (paramObj.MIN === 'number') {
if (typeof paramObj.MIN === 'number') {
dpTypes[dpID].MIN = paramObj.MIN;
dpTypes[dpID].MAX = paramObj.MAX;
// Humidity is from 0 to 99. It is wrong.
Expand Down Expand Up @@ -2071,6 +2066,36 @@ function keepAlive() {
}
} // endKeepAlive

interface ParamsetObjectWithSpecial extends ParamsetObject {
SPECIAL: ParamsetObjectSpecialEntry[];
}

/**
* Derives the common properties of a Paramset SPECIAL attribute
*
* @param paramObj Paramset Object with SPECIAL property
* @param obj ioBroker state object which will be extended
*/
function addCommonSpecial(paramObj: ParamsetObjectWithSpecial, obj: ioBroker.SettableStateObject) {
if (typeof obj.common.states !== 'object' || Array.isArray(obj.common.states)) {
obj.common.states = {};
}

for (const entry of paramObj.SPECIAL) {
obj.common.states[entry.VALUE] = entry.ID;
// see issue #459, SPECIAL can be outside of min/max, we have to adapt
const realVal = paramObj.UNIT === '100%' ? entry.VALUE * 100 : entry.VALUE;

if (obj.common.min !== undefined && realVal < obj.common.min) {
obj.common.min = realVal;
}

if (obj.common.max !== undefined && realVal > obj.common.max) {
obj.common.max = realVal;
}
}
}

// If started as allInOne/compact mode => return function to create instance
if (require.main === module) {
startAdapter({ name: 'hm-rpc' });
Expand Down

0 comments on commit f8b7162

Please sign in to comment.