Compare commits

..
18 Commits
Author SHA1 Message Date
Ingo Fischer 62ce173d22 chore: release v1.3.0
* (Apollon77) Further optimize sending data to HASS and allow to set values like numbers as normal states if the service has one attribute and it can be mapped
2022-07-01 10:10:38 +02:00
Ingo Fischer 45b0550e0c * add logging 2022-06-30 17:42:24 +02:00
Ingo Fischer 0ac6c66aaf * (Apollon77) Further optimize sending data to HASS and allow to set values like numbers as normal states if the service has one attribute and it can be mapped 2022-06-30 11:51:23 +02:00
Ingo Fischer b54916d743 chore: release v1.2.0
* (Apollon77) IMPORTANT: Replace special characters in entity attribute names with an underscore! Object IDs might change!
* (Apollon77) make sure a "null" value in state changes is not crashing
2022-06-17 23:23:11 +02:00
Ingo Fischer 52d8bddb11 * (Apollon77) make sure a "null" value in state changes is not crashing 2022-06-17 23:20:26 +02:00
dependabot[bot]andGitHub 271bd03d14 Update @alcalzone/release-script requirement from ^3.5.8 to ^3.5.9 (#53) 2022-06-01 09:45:24 +00:00
dependabot[bot]andGitHub 36bc7c99fd Update @alcalzone/release-script-plugin-license requirement (#51) 2022-06-01 07:48:32 +00:00
dependabot[bot]andGitHub cc76a49d62 Update @alcalzone/release-script-plugin-iobroker requirement (#54) 2022-06-01 07:05:24 +00:00
dependabot[bot]andGitHub 7a2475ba02 Update @alcalzone/release-script-plugin-license requirement (#47) 2022-05-01 14:15:54 +00:00
dependabot[bot]andGitHub 47cb4cfad8 Update @alcalzone/release-script requirement from ^3.5.6 to ^3.5.8 (#49) 2022-05-01 11:54:23 +00:00
dependabot[bot]andGitHub 2a473f88b0 Update @alcalzone/release-script-plugin-iobroker requirement (#48) 2022-05-01 09:16:22 +00:00
dependabot[bot]andGitHub 245032a178 Bump axios from 0.26.1 to 0.27.2 (#46) 2022-05-01 05:37:18 +00:00
BluefoxandGitHub 96e6c5b471 Merge pull request #45 from ioBroker/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-04-03 14:39:36 +02:00
dependabot[bot]andGitHub 82614cdad0 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 04:20:10 +00:00
Ingo Fischer e6b58530d4 chore: release v1.1.2
* (Apollon77) Fix crash cases reported by Sentry
2022-03-29 09:07:54 +02:00
Ingo Fischer dc47f48004 * (Apollon77) Fix crash cases reported by Sentry (IOBROKER-HASS-2) 2022-03-29 08:59:10 +02:00
Ingo Fischer 4096826099 chore: release v1.1.1
* (Apollon77) Show password fields masked again in config
2022-03-25 09:25:45 +01:00
Ingo Fischer 3021e3f5a5 * (Apollon77) Show password fields masked again in config 2022-03-25 09:25:32 +01:00
7 changed files with 130 additions and 32 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check if PR should be auto-merged
uses: ahmadnassri/action-dependabot-auto-merge@v2
+4 -4
View File
@@ -28,7 +28,7 @@ jobs:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
@@ -56,11 +56,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x, 18.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
@@ -96,7 +96,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
+13
View File
@@ -93,6 +93,19 @@ Please check it https://www.smarthomejetzt.de/mit-iobroker-auf-eine-home-assista
-->
## Changelog
### 1.3.0 (2022-07-01)
* (Apollon77) Further optimize sending data to HASS and allow to set values like numbers as normal states if the service has one attribute and it can be mapped
### 1.2.0 (2022-06-17)
* (Apollon77) IMPORTANT: Replace special characters in entity attribute names with an underscore! Object IDs might change!
* (Apollon77) make sure a "null" value in state changes is not crashing
### 1.1.2 (2022-03-29)
* (Apollon77) Fix crash cases reported by Sentry
### 1.1.1 (2022-03-25)
* (Apollon77) Show password fields masked again in config
### 1.1.0 (2022-03-24)
* IMPORTANT: You need to re-enter the password once after installing this version!
* (Apollon77) Implement Service triggers to use any value to trigger or stringified JSON to call with fields
+2 -2
View File
@@ -85,11 +85,11 @@
<div class="row">
<div class="col s12 m8 l8">
<div class="col s6 m4 input-field">
<input type="text" class="value" id="password" />
<input type="password" class="value" id="password" />
<label for="password" class="translate">Password:</label>
</div>
<div class="col s6 m4 input-field">
<input type="text" class="value" id="passwordRepeat" />
<input type="password" class="value" id="passwordRepeat" />
<label for="passwordRepeat" class="translate">Password repeat:</label>
</div>
</div>
+87 -13
View File
@@ -1,7 +1,7 @@
{
"common": {
"name": "hass",
"version": "1.1.0",
"version": "1.3.0",
"title": "Home Assistant",
"titleLang": {
"en": "Home Assistant",
@@ -28,6 +28,54 @@
"zh-cn": "ioBroker 的家庭助理连接"
},
"news": {
"1.3.0": {
"en": "Further optimize sending data to HASS and allow to set values like numbers as normal states if the service has one attribute and it can be mapped",
"de": "Weitere optimieren Sie das Senden von Daten an HASS und ermöglichen es, Werte wie Zahlen als normale Zustände festzulegen, wenn der Dienst ein Attribut hat und es abgebildet werden kann",
"ru": "Далее оптимизируйте отправку данных в HASS и позвольте установить значения, такие как цифры, как нормальные состояния, если услуга имеет один атрибут, и она может быть загружена",
"pt": "Além disso otimizar o envio de dados para HASS e permitir definir valores como números como estados normais se o serviço tem um atributo e pode ser mapeado",
"nl": "Verder optimiliseer het sturen van gegevens naar HASS en sta toe om waarden als normale staten te plaatsen als de dienst een Attribuut heeft en het kan worden in kaart gebracht",
"fr": "Optimiser l'envoi de données à HASS et permettre de définir des valeurs comme des nombres comme des états normaux si le service a un attribut et il peut être mappé",
"it": "Ottimizzare ulteriormente l'invio di dati a HASS e consentire di impostare valori come numeri come stati normali se il servizio ha un attributo e può essere mappato",
"es": "Optimizar aún más el envío de datos a HASS y permitir establecer valores como números como estados normales si el servicio tiene un atributo y puede ser mapeado",
"pl": "Dalsze optymalizowanie danych do HASS i umożliwienie ustalenie wartości takich jak stany normalne, jeśli usługa ma jeden atrybut i może być zmapowana",
"zh-cn": "进一步优化向人道协调厅系统传送数据,如果该服务具有属性,它可以绘制图表,从而能够将数字象正常国家一样。"
},
"1.2.0": {
"en": "IMPORTANT: Replace special characters in entity attribute names with an underscore! Object IDs might change!\nmake sure a \"null\" value in state changes is not crashing",
"de": "WICHTIG: Ersetzen Sie Sonderzeichen in Namen des Attributes der Einheit mit einem Unterpunkt! Objekt-IDs können sich ändern!\nsicherstellen, dass ein nullwert bei zustandsänderungen nicht abstürzt",
"ru": "ВАЖНО: Замените специальные символы в имени сущности с подчеркиванием! ID объекта может измениться!\nубедитесь, что значение null в государственных изменениях не падает",
"pt": "IMPORTANTE: Substitua caracteres especiais em nomes de atributos de entidade com um sublinhado! IDs de objeto podem mudar!\ncertifique-se de que um valor nulo em mudanças de estado não está caindo",
"nl": "Vervang speciale personages in entiteitsadvocaten met een onderscore! ID's kunnen veranderen!\nzorg ervoor dat een waarde van de staat niet crasht",
"fr": "IMPORTANT: Remplacer les caractères spéciaux dans les noms d'attributs d'entité par un accent! Les identifiants d'objet peuvent changer !\ns'assurer qu'une valeur nulle dans les changements d'état ne s'écrase pas",
"it": "IMPORTANTE: Sostituisci caratteri speciali in nomi attributo entità con un underscore! Gli ID degli Oggetti potrebbero cambiare!\nassicurarsi che un valore nullo nei cambiamenti di stato non è crash",
"es": "IMPORTANTE: Reemplazar caracteres especiales en nombres de atributos de entidad con un subrayado! ¡Las identificaciones de objetos pueden cambiar!\nasegúrese de que un valor nulo en los cambios estatales no se estrella",
"pl": "IMPORTANT: Replace special characters in identity attribution names with an underscore! (ang.). Zmiany obiektów mogą się zmieniać!\nniewątpliwą wartością w zmianach stanowych nie jest rozbicie się",
"zh-cn": "IMPORTANT:将实体的特色性改为强调的! 目标国际组织可能改变!\n确保在国家变化中确保无效不失"
},
"1.1.2": {
"en": "Fix crash cases reported by Sentry",
"de": "Von Sentry gemeldete Absturzfälle beheben",
"ru": "Исправить случаи сбоев, о которых сообщил Sentry",
"pt": "Corrigir casos de travamento relatados pelo Sentinela",
"nl": "Herstel crashgevallen gemeld door Sentry",
"fr": "Correction des cas de plantage signalés par Sentry",
"it": "Risolvi i casi di crash segnalati da Sentry",
"es": "Solucionar casos de fallas informados por Sentry",
"pl": "Napraw przypadki awarii zgłoszone przez Sentry",
"zh-cn": "修复 Sentry 报告的崩溃案例"
},
"1.1.1": {
"en": "Show password fields masked again in config",
"de": "Passwortfelder in config wieder maskiert anzeigen",
"ru": "Показать поля пароля снова замаскированные в конфигурации",
"pt": "Mostrar campos de senha mascarados novamente na configuração",
"nl": "Toon wachtwoordvelden opnieuw gemaskeerd in config",
"fr": "Afficher à nouveau les champs de mot de passe masqués dans la configuration",
"it": "Mostra i campi password mascherati di nuovo in config",
"es": "Mostrar campos de contraseña enmascarados nuevamente en la configuración",
"pl": "Pokaż ponownie zamaskowane pola haseł w konfiguracji",
"zh-cn": "在配置中再次显示被屏蔽的密码字段"
},
"1.1.0": {
"en": "IMPORTANT: You need to re-enter the password once after installing this version!\nImplement Service triggers to use any value to trigger or stringified JSON to call with fields\nOptimize unload handling\nAdd Sentry for crash reporting",
"de": "WICHTIG: Nach der Installation dieser Version müssen Sie das Passwort einmalig neu eingeben!\nImplementieren Sie Dienstauslöser, um einen beliebigen Wert zum Auslösen oder stringifiziertes JSON zum Aufrufen mit Feldern zu verwenden\nEntladehandling optimieren\nFügen Sie Sentry für Absturzberichte hinzu",
@@ -63,18 +111,6 @@
"es": "agregó el soporte del modo compacto",
"pl": "dodano obsługę trybu kompaktowego",
"zh-cn": "增加了对紧凑模式的支持"
},
"0.1.0": {
"en": "initial version",
"de": "erste Version",
"ru": "Первоначальная версия",
"pt": "versão inicial",
"nl": "eerste versie",
"fr": "version initiale",
"it": "versione iniziale",
"es": "versión inicial",
"pl": "początkowa wersja",
"zh-cn": "初始版本"
}
},
"localLink": "http://%host%:8123",
@@ -153,6 +189,44 @@
"agree",
"cancel"
]
},
{
"condition": {
"operand": "and",
"rules": [
"oldVersion<1.2.0",
"newVersion>=1.2.0"
]
},
"title": {
"en": "Important notice!",
"de": "Wichtiger Hinweis!",
"ru": "Важное замечание!",
"pt": "Notícia importante!",
"nl": "Belangrijke mededeling!",
"fr": "Avis important!",
"it": "Avviso IMPORTANTE!",
"es": "Noticia importante!",
"pl": "Ważna uwaga!",
"zh-cn": "重要通知!"
},
"text": {
"en": "The new version 1.2.x will potentially change the Names of Objects when special characters like \".\", \"-\" or spaces were used in entity attributes! Please delete the old objects manually if needed.",
"de": "Die neue Version 1.2.x wird die Namen von Objekten möglicherweise ändern, wenn spezielle Zeichen wie \".\", \"-\" oder Leerzeichen in Entity-Attributen verwendet wurden! Alten Objekte bitte bei Bedarf manuell löschen.",
"ru": "Новая версия 1.2.x будет потенциально менять имена объектов, когда специальные символы типа \".\", \"-\" или пространства были использованы в атрибутах лица! Пожалуйста, удалите старые объекты вручную, если это необходимо.",
"pt": "A nova versão 1.2.x irá potencialmente alterar os Nomes de Objetos quando caracteres especiais como \".\", \"-\" ou espaços foram usados em atributos de entidade! Por favor, exclua os objetos antigos manualmente, se necessário.",
"nl": "De nieuwe versie 1.2.x zal de Namen van Objects veranderen als speciale personages zoals \", \" of ruimtes werden gebruikt in entiteitsaanklachten! Verwijder de oude objecten handmatig als het nodig is.",
"fr": "La nouvelle version 1.2.x modifiera potentiellement les Noms des Objets lorsque des caractères spéciaux comme \", \"-\" ou des espaces ont été utilisés dans des attributs d'entité ! Veuillez supprimer les anciens objets manuellement si nécessaire.",
"it": "La nuova versione 1.2.x cambierà potenzialmente i nomi degli oggetti quando caratteri speciali come \".\", \"-\" o spazi sono stati utilizzati negli attributi dell'entità! Si prega di eliminare i vecchi oggetti manualmente se necessario.",
"es": "La nueva versión 1.2.x potencialmente cambiará los Nombres de Objetos cuando caracteres especiales como \"., \"-\" o espacios fueron utilizados en atributos de entidad! Por favor, borre los viejos objetos manualmente si es necesario.",
"pl": "Nowa wersja 1.2.x będzie potencjalnie zmieniać nazwy obiektów, kiedy szczególne postacie takie jak „.”, „-” lub przestrzenie były używane w atrybutach. Okazuje się, że stare obiekty ręcznie będą potrzebne.",
"zh-cn": "新版本1.2.x将可能改变物体的名称,如“......”、“-”或空间在实体的属性中使用。 请在必要时删除旧物体。."
},
"level": "warn",
"buttons": [
"agree",
"cancel"
]
}
]
},
+16 -5
View File
@@ -40,15 +40,26 @@ function startAdapter(options) {
const target = {};
let requestFields = {};
if (typeof state.val === 'string') {
if (typeof state.val === 'string' && state.val.startsWith('{') && state.val.endsWith('}')) {
try {
requestFields = JSON.parse(state.val);
requestFields = JSON.parse(state.val) || {};
} catch (err) {
adapter.log.info(`Ignore data for service call ${id} is no valid JSON: ${err.message}`);
requestFields = {};
}
}
// If a non-JSON value was set and we only have one relevant field, use this field as value
if (Object.keys(requestFields).length === 0) {
const fieldList = Object.keys(fields);
if (fieldList.length === 1 && fieldList[0] !== 'entity_id') {
requestFields[fieldList[0]] = state.val;
} else if (fieldList.length === 2 && fields.entity_id) {
requestFields[fieldList[1 - fields.indexOf('entity_id')]] = state.val;
}
}
adapter.log.debug('Prepare service call for ' + id + ' with (mapped) request parameters ' + JSON.stringify(requestFields));
for (const field in fields) {
if (!fields.hasOwnProperty(field)) {
continue;
@@ -284,7 +295,7 @@ function parseStates(entities, services, callback) {
}
obj = {
_id: `${adapter.namespace}.entities.${entity.entity_id}.${attr}`,
_id: `${adapter.namespace}.entities.${entity.entity_id}.${attr.replace(adapter.FORBIDDEN_CHARS, '_')}`,
type: 'state',
common: common,
native: {
@@ -383,14 +394,14 @@ function main() {
}
if (entity.attributes) {
for (const attr in entity.attributes) {
if (!entity.attributes.hasOwnProperty(attr) || attr === 'friendly_name' || attr === 'unit_of_measurement' || attr === 'icon') {
if (!entity.attributes.hasOwnProperty(attr) || attr === 'friendly_name' || attr === 'unit_of_measurement' || attr === 'icon'|| !attr.length) {
continue;
}
let val = entity.attributes[attr];
if ((typeof val === 'object' && val !== null) || Array.isArray(val)) {
val = JSON.stringify(val);
}
adapter.setForeignState(id + attr, {val, ack: true, lc, ts});
adapter.setForeignState(id + attr.replace(adapter.FORBIDDEN_CHARS, '_'), {val, ack: true, lc, ts});
}
}
});
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "iobroker.hass",
"version": "1.1.0",
"version": "1.3.0",
"description": "Home Assistant",
"author": {
"name": "bluefox",
@@ -26,16 +26,16 @@
},
"dependencies": {
"websocket": "^1.0.34",
"ws": "^8.5.0",
"ws": "^8.8.0",
"@iobroker/adapter-core": "^2.6.0"
},
"devDependencies": {
"@alcalzone/release-script": "^3.5.6",
"@alcalzone/release-script-plugin-iobroker": "^3.5.7",
"@alcalzone/release-script-plugin-license": "^3.5.3",
"axios": "^0.26.1",
"@alcalzone/release-script": "^3.5.9",
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
"@alcalzone/release-script-plugin-license": "^3.5.9",
"axios": "^0.27.2",
"gulp": "^4.0.2",
"mocha": "^9.2.2",
"mocha": "^10.0.0",
"chai": "^4.3.6"
},
"main": "main.js",