iobroker.sonoff 2.5.1 → 2.5.7

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.
@@ -0,0 +1,54 @@
1
+ {
2
+ "Adapter settings": "Sonoff设置",
3
+ "Authentication settings": "验证设定",
4
+ "Auto creation of states": "自动创建状态",
5
+ "Chained certificate:": "连锁证书",
6
+ "Client": "客户/订户",
7
+ "Client ID:": "客户编号",
8
+ "Connection": "连接",
9
+ "Connection settings": "连接设定",
10
+ "Divided by comma": "除以逗号,例如 'mqtt/0/#,javascript/#'",
11
+ "For stat/RESULT": "对于统计/结果",
12
+ "For tele/SENSOR": "对于电话/传感器",
13
+ "For tele/STATE": "对于电话/状态",
14
+ "IP": "IP",
15
+ "Ignore warnings with pingreq": "忽略pingreq警告",
16
+ "Interval before send topics by connection:": "通过连接发送主题之前的时间间隔",
17
+ "Main settings": "主要设定",
18
+ "Mask to publish": "例如 'mqtt.0.*,javascript.*'",
19
+ "Mask to publish own states:": "遮罩以发布自己的状态",
20
+ "Max topic length:": "主题名称的最大长度",
21
+ "Password confirmation:": "确认密码",
22
+ "Password:": "密码",
23
+ "Patterns:": "订阅模式",
24
+ "Port:": "港口",
25
+ "Prefix for topics:": "所有主题的前缀",
26
+ "Private certificate:": "私人证书",
27
+ "Public certificate:": "公开证书",
28
+ "Publish all states at start:": "在连接上发布自己的状态",
29
+ "Publish states on subscribe:": "发布订阅状态",
30
+ "Result: ": "结果",
31
+ "Secure:": "安全",
32
+ "Send interval:": "发送间隔",
33
+ "Send states (ack=true) too:": "也发送状态(ack=true)",
34
+ "Server": "服务器/经纪人",
35
+ "Set certificates or load it first in the system settings (right top).": "设置证书或先将其加载到系统设置中(右上角)。",
36
+ "Sonoff Settings": "Sonoff设置",
37
+ "Sonoff adapter settings": "Sonoff适配器设置",
38
+ "Store only on change:": "仅在更改时发布",
39
+ "Test connection": "测试与服务器的连接",
40
+ "Trace output for every message:": "跟踪每条消息的输出",
41
+ "Type:": "类型",
42
+ "URL:": "网址",
43
+ "Use WebSockets:": "也使用WebSockets",
44
+ "Use chunk patch:": "使用大块补丁",
45
+ "Use different topic names for set and get:": "使用不同的主题名称进行设置和获取",
46
+ "User:": "用户",
47
+ "chars": "字符",
48
+ "connected": "连接的",
49
+ "ms": "毫秒",
50
+ "Client timeout": "客户端超时",
51
+ "Create object tree": "创建对象树",
52
+ "WARNING! Check README.md!": "警告!检查 README.md!",
53
+ "Other settings": "其他设置"
54
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "type": "panel",
3
+ "i18n": true,
4
+ "items": {
5
+ "_header1": {
6
+ "type": "header",
7
+ "text": "Connection settings",
8
+ "size": 3,
9
+ "sm": 12
10
+ },
11
+ "bind": {
12
+ "newLine": true,
13
+ "type": "ip",
14
+ "label": "IP",
15
+ "listenOnAllPorts": true,
16
+ "sm": 10,
17
+ "md": 8,
18
+ "lg": 3
19
+ },
20
+ "port": {
21
+ "label": "Port",
22
+ "type": "number",
23
+ "min": 1,
24
+ "max": 65535,
25
+ "sm": 2,
26
+ "md": 2,
27
+ "lg": 1
28
+ },
29
+ "timeout": {
30
+ "label": "Client timeout",
31
+ "help": "in seconds",
32
+ "type": "number",
33
+ "min": 1,
34
+ "max": 99999,
35
+ "md": 2,
36
+ "lg": 1
37
+ },
38
+ "_header2": {
39
+ "newLine": true,
40
+ "type": "header",
41
+ "text": "Authentication settings",
42
+ "size": 3,
43
+ "sm": 12
44
+ },
45
+ "user": {
46
+ "newLine": true,
47
+ "type": "text",
48
+ "label": "User",
49
+ "sm": 12,
50
+ "md": 4,
51
+ "lg": 2
52
+ },
53
+ "pass": {
54
+ "sm": 12,
55
+ "md": 8,
56
+ "lg": 4,
57
+ "type": "password",
58
+ "label": "Password",
59
+ "repeat": true
60
+ },
61
+ "_header3": {
62
+ "newLine": true,
63
+ "type": "header",
64
+ "text": "Auto creation of states",
65
+ "size": 3,
66
+ "sm": 12
67
+ },
68
+ "TELE_SENSOR": {
69
+ "newLine": true,
70
+ "type": "checkbox",
71
+ "label": "For tele/SENSOR",
72
+ "sm": 6,
73
+ "md": 3,
74
+ "lg": 2
75
+ },
76
+ "TELE_STATE": {
77
+ "type": "checkbox",
78
+ "label": "For tele/STATE",
79
+ "sm": 6,
80
+ "md": 3,
81
+ "lg": 2
82
+ },
83
+ "STAT_RESULT": {
84
+ "type": "checkbox",
85
+ "label": "For stat/RESULT",
86
+ "sm": 6,
87
+ "md": 3,
88
+ "lg": 2
89
+ },
90
+ "OBJ_TREE": {
91
+ "type": "checkbox",
92
+ "label": "Create object tree",
93
+ "help": "WARNING! Check README.md!",
94
+ "sm": 6,
95
+ "md": 3,
96
+ "lg": 2
97
+ },
98
+ "_header4": {
99
+ "newLine": true,
100
+ "type": "header",
101
+ "text": "Other settings",
102
+ "size": 3,
103
+ "sm": 12
104
+ },
105
+ "ignorePings": {
106
+ "newLine": true,
107
+ "type": "checkbox",
108
+ "label": "Ignore warnings with pingreq",
109
+ "sm": 12
110
+ }
111
+ }
112
+ }
package/admin/words.js CHANGED
@@ -16,19 +16,19 @@ systemDictionary = {
16
16
  "For stat/RESULT": { "en": "For stat/RESULT", "de": "Für stat/RESULT", "ru": "Для stat/RESULT", "pt": "Para stat/RESULT", "nl": "Voor stat/RESULT", "fr": "Pour stat/RESULT", "it": "Per stat/RESULT", "es": "Por stat/RESULT", "pl": "Dla stat/RESULT", "zh-cn": "对于统计/结果"},
17
17
  "For tele/SENSOR": { "en": "For tele/SENSOR", "de": "Für tele/SENSOR", "ru": "Для tele/SENSOR", "pt": "Para tele/SENSOR", "nl": "Voor tele/SENSOR", "fr": "Pour tele/SENSOR", "it": "Per tele/SENSOR", "es": "Por tele/SENSOR", "pl": "Dla tele/SENSOR", "zh-cn": "对于电话/传感器"},
18
18
  "For tele/STATE": { "en": "For tele/STATE", "de": "Für tele/STATE", "ru": "Для tele/STATE", "pt": "Para tele/STATE", "nl": "Voor tele/STATE", "fr": "Pour tele/STATE", "it": "Per tele/STATE", "es": "Por tele/STATE", "pl": "Dla tele/STATE", "zh-cn": "对于电话/状态"},
19
- "IP": { "en": "IP", "de": "IP-Adresse", "ru": "IP", "pt": "IP", "nl": "IP", "fr": "IP", "it": "IP", "es": "IP", "pl": "IP", "zh-cn": "知识产权"},
20
- "Ignore warnings with pingreq": { "en": "Ignore warnings with pingreq", "de": "Warnungen mit pingreq ignorieren", "ru": "Игнорировать предупреждения с помощью pingreq", "pt": "Ignore os avisos com pingreq", "nl": "Negeer waarschuwingen met pingreq", "fr": "Ignorer les avertissements avec pingreq", "it": "Ignora gli avvisi con pingreq", "es": "Ignore las advertencias con pingreq", "pl": "Ignoruj ​​ostrzeżenia za pomocą polecenia pingreq", "zh-cn": "使用pingreq忽略警告"},
19
+ "IP": { "en": "IP", "de": "IP-Adresse", "ru": "IP", "pt": "IP", "nl": "IP", "fr": "IP", "it": "IP", "es": "IP", "pl": "IP", "zh-cn": "IP"},
20
+ "Ignore warnings with pingreq": { "en": "Ignore warnings with pingreq", "de": "Warnungen mit pingreq ignorieren", "ru": "Игнорировать предупреждения с помощью pingreq", "pt": "Ignore os avisos com pingreq", "nl": "Negeer waarschuwingen met pingreq", "fr": "Ignorer les avertissements avec pingreq", "it": "Ignora gli avvisi con pingreq", "es": "Ignore las advertencias con pingreq", "pl": "Ignoruj ​​ostrzeżenia za pomocą polecenia pingreq", "zh-cn": "忽略pingreq警告"},
21
21
  "Interval before send topics by connection:": { "en": "Interval before send topics by connection", "de": "Interval vom Senden von allen Topics bei der Verbindung", "ru": "Интервал перед отсылкой всей топиков после соединения", "pt": "Intervalo antes de enviar tópicos por conexão", "nl": "Intervalo antes de enviar tópicos por conexão", "fr": "Intervalle avant d'envoyer des sujets par connexion", "it": "Intervallo prima di inviare argomenti per connessione", "es": "Intervalo antes de enviar temas por conexión", "pl": "Interwał przed wysłaniem tematów według połączenia", "zh-cn": "通过连接发送主题之前的时间间隔"},
22
- "Main settings": { "en": "Main settings", "de": "Allgemeine Einstellungen", "ru": "Основные настройки", "pt": "Configurações principais", "nl": "Configurações principais", "fr": "Réglages principaux", "it": "Impostazioni principali", "es": "Ajustes principales", "pl": "Ustawienia główne", "zh-cn": "主要设定"},
22
+ "Main settings": { "en": "Main settings", "de": "Haupteinstellungen", "ru": "Основные настройки", "pt": "Configurações principais", "nl": "Configurações principais", "fr": "Réglages principaux", "it": "Impostazioni principali", "es": "Ajustes principales", "pl": "Ustawienia główne", "zh-cn": "主要设定"},
23
23
  "Mask to publish": { "en": "e.g. 'mqtt.0.*,javascript.*'", "de": "z.B 'mqtt.0.*,javascript.*'", "ru": "Использовать запятую, как разделитеть. Например 'mqtt.0.*,javascript.*'", "pt": "por exemplo. 'mqtt.0. *, javascript. *'", "nl": "por exemplo. 'mqtt.0.*, javascript.*'", "fr": "par exemple. 'mqtt.0.*, javascript.*'", "it": "per esempio. 'Mqtt.0. *, Javascript. *'", "es": "p.ej. 'mqtt.0.*, javascript.*'", "pl": "na przykład \"mqtt.0. *, javascript. *\"", "zh-cn": "例如 'mqtt.0.*,javascript.*'"},
24
24
  "Mask to publish own states:": { "en": "Mask to publish own states", "de": "Maske für Bekanntgeben von eigenen States", "ru": "Маска для собственных значений", "pt": "Máscara para publicar estados próprios", "nl": "Máscara para publicar estados próprios", "fr": "Masque pour publier ses propres états", "it": "Maschera per pubblicare i propri stati", "es": "Máscara para publicar estados propios", "pl": "Maskuj, aby publikować własne stany", "zh-cn": "遮罩以发布自己的状态"},
25
25
  "Max topic length:": { "en": "Max topic name length", "de": "Maximale Topicnamelänge", "ru": "Максимальная длина имени топика", "pt": "Nome máximo do nome do tópico", "nl": "Nome máximo do nome do tópico", "fr": "Longueur maximale du nom de la rubrique", "it": "Lunghezza massima del nome dell'argomento", "es": "Longitud máxima del nombre del tema", "pl": "Maksymalna długość nazwy tematu", "zh-cn": "主题名称的最大长度"},
26
26
  "Password confirmation:": { "en": "Password confirmation", "de": "Passwort-Wiederholung", "ru": "Подтверждение пароля", "pt": "ConfirmaÇão Da Senha", "nl": "ConfirmaÇão Da Senha", "fr": "Confirmation mot de passe", "it": "conferma password", "es": "confirmación de contraseña", "pl": "Potwierdzenie hasła", "zh-cn": "确认密码"},
27
- "Password:": { "en": "Password", "de": "Kennwort", "ru": "Пароль", "pt": "Senha", "nl": "Senha", "fr": "Mot de passe", "it": "Parola d'ordine", "es": "Contraseña", "pl": "Hasło", "zh-cn": "密码"},
27
+ "Password:": { "en": "Password", "de": "Passwort", "ru": "Пароль", "pt": "Senha", "nl": "Senha", "fr": "Mot de passe", "it": "Parola d'ordine", "es": "Contraseña", "pl": "Hasło", "zh-cn": "密码"},
28
28
  "Patterns:": { "en": "Subscribe patterns", "de": "Subscribe patterns", "ru": "Шаблоны подписки", "pt": "Assinar padrões", "nl": "Assinar padrões", "fr": "Modèles de souscription", "it": "Iscriviti modelli", "es": "Suscribir patrones", "pl": "Wzorce subskrypcji", "zh-cn": "订阅模式"},
29
29
  "Port:": { "en": "Port", "de": "Port", "ru": "Порт", "pt": "Porta", "nl": "Porta", "fr": "Port", "it": "Porta", "es": "Puerto", "pl": "Port", "zh-cn": "港口"},
30
30
  "Prefix for topics:": { "en": "Prefix for all topics", "de": "Prefix für alle Topics", "ru": "Префикс для всех значений", "pt": "Prefix para todos os tópicos", "nl": "Prefix para todos os tópicos", "fr": "Préfixe pour tous les sujets", "it": "Prefisso per tutti gli argomenti", "es": "Prefijo para todos los temas", "pl": "Prefiks dla wszystkich tematów", "zh-cn": "所有主题的前缀"},
31
- "Private certificate:": { "en": "Private certificate", "de": "Privatzertifikat", "ru": "'Private' сертификат", "pt": "Certificado privado", "nl": "Certificado privado", "fr": "Certificat privé", "it": "Certificato privato", "es": "Certificado privado", "pl": "Prywatny certyfikat", "zh-cn": "私人证书"},
31
+ "Private certificate:": { "en": "Private certificate", "de": "Privates Zertifikat", "ru": "'Private' сертификат", "pt": "Certificado privado", "nl": "Certificado privado", "fr": "Certificat privé", "it": "Certificato privato", "es": "Certificado privado", "pl": "Prywatny certyfikat", "zh-cn": "私人证书"},
32
32
  "Public certificate:": { "en": "Public certificate", "de": "Publikzertifikat", "ru": "'Public' сертификат", "pt": "Certificado público", "nl": "Certificado público", "fr": "Certificat public", "it": "Certificato pubblico", "es": "Certificado público", "pl": "Certyfikat publiczny", "zh-cn": "公开证书"},
33
33
  "Publish all states at start:": { "en": "Publish own states on connect", "de": "Bekanntgeben eigene States beim Verbinden", "ru": "Выдавать собственные значения при старте", "pt": "Publique seus próprios estados na conexão", "nl": "Publique seus próprios estados na conexão", "fr": "Publier ses propres états sur se connecter", "it": "Pubblica i tuoi stati sulla connessione", "es": "Publicar estados propios al conectar", "pl": "Opublikuj własne stany przy połączeniu", "zh-cn": "在连接上发布自己的状态"},
34
34
  "Publish states on subscribe:": { "en": "Publish states on subscribe", "de": "Bekanntgeben von States bei Subscribe", "ru": "Публиковать состояния при подписке", "pt": "Publique estados na assinatura", "nl": "Publique estados na assinatura", "fr": "Publier les états sur l'abonnement", "it": "Pubblica stati su iscriviti", "es": "Publicar estados al suscribirse", "pl": "Opublikuj stany w subskrypcji", "zh-cn": "发布订阅状态"},
@@ -51,5 +51,5 @@ systemDictionary = {
51
51
  "User:": { "en": "User", "de": "Benutzer", "ru": "Имя пользователя", "pt": "Utilizador", "nl": "Do utilizador", "fr": "Utilisateur", "it": "Utente", "es": "Usuario", "pl": "Użytkownik", "zh-cn": "用户"},
52
52
  "chars": { "en": "chars", "de": "Symbolen", "ru": "символов", "pt": "caracteres", "nl": "caracteres", "fr": "chars", "it": "caratteri", "es": "caracteres", "pl": "znaki", "zh-cn": "字符"},
53
53
  "connected": { "en": "connected", "de": "verbunden", "ru": "успешно", "pt": "conectado", "nl": "conectado", "fr": "connecté", "it": "collegato", "es": "conectado", "pl": "połączony", "zh-cn": "连接的"},
54
- "ms": { "en": "ms", "de": "ms", "ru": "мс", "pt": "Senhora", "nl": "Senhora", "fr": "Mme", "it": "Signorina", "es": "Sra", "pl": "ms", "zh-cn": "女士"},
54
+ "ms": { "en": "ms", "de": "ms", "ru": "мс", "pt": "Senhora", "nl": "Senhora", "fr": "Mme", "it": "Signorina", "es": "Sra", "pl": "ms", "zh-cn": "毫秒"},
55
55
  };
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "sonoff",
4
- "version": "2.5.1",
4
+ "version": "2.5.7",
5
5
  "news": {
6
+ "2.5.7": {
7
+ "en": "Disabled the logging of username and password during connection errors\nadded json config",
8
+ "de": "Deaktiviert die Protokollierung von Benutzername und Passwort während der Verbindungsfehler\nadd json config",
9
+ "ru": "Отключение логина имени пользователя и пароля во время ошибок соединения\nдобавлено json config",
10
+ "pt": "Desativado o registro de nome de usuário e senha durante erros de conexão\nadicionado json config",
11
+ "nl": "De logeerkamer van gebruikers en wachtwoord tijdens de verbindingsfouten\nvoegde json config",
12
+ "fr": "Handicapés l'enregistrement du nom d'utilisateur et du mot de passe lors des erreurs de connexion\najouté json config",
13
+ "it": "Disattivare la registrazione di nome utente e password durante gli errori di connessione\naggiunto json config",
14
+ "es": "Desactivar el registro de nombre de usuario y contraseña durante errores de conexión\njson config",
15
+ "pl": "Dysponował logowaniem nazwy użytkownika i hasła podczas błędów połączenia\ndodał json configig",
16
+ "uk": "Вимкнено логування імені користувача та пароля під час помилок підключення\nдодано json config",
17
+ "zh-cn": "残疾人在联系错误期间的用户名称和密码\nj的额外活动"
18
+ },
19
+ "2.5.3": {
20
+ "en": "Implemented potential `.STATE.POWER` update",
21
+ "de": "Ergänzendes Potenzial STATE. POWER Update",
22
+ "ru": "Реализованный потенциал ГОСУДАРСТВО. POWER обновление",
23
+ "pt": "Potencial implementado ESTADO. Atualização do POWER",
24
+ "nl": "Implementie potentieel Stop. Vertaling:",
25
+ "fr": "Possibilités mises en œuvre Arrête. Mise à jour du POWER",
26
+ "it": "Potenziale attuato STATO. Aggiornamento del potere",
27
+ "es": "Potencial aplicado ESTADO. Actualización de POWER",
28
+ "pl": "Implementacja potencjału Staw. POWER",
29
+ "uk": "Реалізований потенціал ДЕРЖАВИ. Оновлення енергії",
30
+ "zh-cn": "执行潜力 国家。 导 言"
31
+ },
6
32
  "2.5.1": {
7
33
  "en": "Fix crash case reported by Sentry",
8
34
  "de": "Absturzfall behoben, der von Sentry gemeldet wurde",
@@ -62,30 +88,6 @@
62
88
  "es": "Arregle algunos casos de fallas reportados por Sentry",
63
89
  "pl": "Napraw niektóre przypadki awarii zgłoszone przez Sentry",
64
90
  "zh-cn": "修复 Sentry 报告的一些崩溃案例"
65
- },
66
- "2.4.4": {
67
- "en": "Added UvaIntensity and UvbIntensity",
68
- "de": "UvaIntensity und UvbIntensity hinzugefügt",
69
- "ru": "Добавлены UvaIntensity и UvbIntensity.",
70
- "pt": "Adicionados UvaIntensity e UvbIntensity",
71
- "nl": "UvaIntensity en UvbIntensity toegevoegd",
72
- "fr": "Ajout d'UvaIntensity et UvbIntensity",
73
- "it": "Aggiunti UvaIntensity e UvbIntensity",
74
- "es": "Se agregaron UvaIntensity y UvbIntensity",
75
- "pl": "Dodano UvaIntensity i UvbIntensity",
76
- "zh-cn": "添加了 UvaIntensity 和 UvbIntensity"
77
- },
78
- "2.4.3": {
79
- "en": "Better type detection for non-described states",
80
- "de": "Bessere Typerkennung für nicht beschriebene Zustände",
81
- "ru": "Лучшее определение типа для неописанных состояний",
82
- "pt": "Melhor detecção de tipo para estados não descritos",
83
- "nl": "Betere typedetectie voor niet-beschreven toestanden",
84
- "fr": "Meilleure détection de type pour les états non décrits",
85
- "it": "Migliore rilevamento del tipo per gli stati non descritti",
86
- "es": "Mejor detección de tipos para estados no descritos",
87
- "pl": "Lepsze wykrywanie typów dla stanów nieopisanych",
88
- "zh-cn": "更好的未描述状态的类型检测"
89
91
  }
90
92
  },
91
93
  "title": "Sonoff",
@@ -125,6 +127,9 @@
125
127
  "loglevel": "info",
126
128
  "icon": "sonoff.png",
127
129
  "materialize": true,
130
+ "adminUI": {
131
+ "config": "json"
132
+ },
128
133
  "keywords": [
129
134
  "ITEAD",
130
135
  "MQTT",
package/lib/server.js CHANGED
@@ -1,7 +1,3 @@
1
- /* jshint -W097 */
2
- /* jshint strict:true */
3
- /* jslint node: true */
4
- /* jslint esversion: 6 */
5
1
  'use strict';
6
2
 
7
3
  const mqtt = require('mqtt-connection');
@@ -1061,7 +1057,22 @@ function MQTTServer(adapter) {
1061
1057
  val = data[attr];
1062
1058
  }
1063
1059
  }
1060
+ let powerStateFound = false;
1061
+ // due to some (for ex. NSPanel) versions do not automatically update .POWER from .STATE.POWER
1062
+ // but this is generally a default for all devices (state cannot differ from switch) we now keep
1063
+ // STATE changes to POWER in sync with POWER switches
1064
+ if (obj.id.includes('.STATE.POWER')) {
1065
+ powerStateFound = true;
1066
+ }
1067
+
1064
1068
  updateState(obj, val);
1069
+
1070
+ if (powerStateFound) {
1071
+ adapter.log.debug(`Got .STATE.POWER update, auto syncing .POWER (src: ${obj.id})`);
1072
+ let powerObj = Object.assign({}, obj);
1073
+ powerObj.id = powerObj.data._id = powerObj.id.replace('.STATE.POWER', '.POWER');
1074
+ updateState(powerObj, val);
1075
+ }
1065
1076
  } else {
1066
1077
  // not in list, auto insert
1067
1078
  //if (client.id=='DVES_008ADB') {
@@ -1106,7 +1117,25 @@ function MQTTServer(adapter) {
1106
1117
  }
1107
1118
  };
1108
1119
  obj.data.common.name = `${client.id} ${prefix ? `${prefix} ` : ''}${path.length ? `${path.join(' ')} ` : ''} ${replaceAttr}`;
1109
- updateState(obj, val);
1120
+ // due to some (for ex. NSPanel) versions do not automatically send .POWER switch data
1121
+ // but this is generally a default for all devices (state cannot exist without switch) we now add
1122
+ // POWER switches automatically if we get POWER STATE
1123
+ let powerStateFound = false;
1124
+ if (obj.id.includes('.STATE.POWER')) {
1125
+ powerStateFound = true;
1126
+ }
1127
+
1128
+ updateState(obj, val);
1129
+
1130
+ if (powerStateFound) {
1131
+ adapter.log.debug(`Got .STATE.POWER value message -> auto add .POWER object from ${obj.id}`);
1132
+ let powerId = obj.id.replace('.STATE.POWER', '.POWER');
1133
+ let powerName = obj.data.common.name.replace(' STATE POWER', ' POWER');
1134
+ let powerObj = Object.assign({}, obj);
1135
+ powerObj.id = powerObj.data._id = powerId;
1136
+ powerObj.data.common.name = powerName;
1137
+ updateState(powerObj, val);
1138
+ }
1110
1139
  }
1111
1140
  }
1112
1141
  }
@@ -1426,7 +1455,7 @@ function MQTTServer(adapter) {
1426
1455
  }
1427
1456
  if (config.user !== options.username ||
1428
1457
  config.pass !== options.password) {
1429
- adapter.log.warn(`Client [${client.id}] has invalid password(${options.password}) or username(${options.username})`);
1458
+ adapter.log.warn(`Client [${client.id}] has invalid password or username`);
1430
1459
  client.connack({returnCode: 4});
1431
1460
  if (oldClient) {
1432
1461
  // delete existing client
package/main.js CHANGED
@@ -1,13 +1,8 @@
1
- /* jshint -W097 */
2
- /* jshint strict:true */
3
- /* jslint node: true */
4
- /* jslint esversion: 6 */
5
-
6
1
  /**
7
2
  *
8
3
  * ioBroker sonoff Adapter
9
4
  *
10
- * (c) 2017-2021 bluefox
5
+ * (c) 2017-2023 bluefox
11
6
  *
12
7
  * MIT License
13
8
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "iobroker.sonoff",
3
3
  "description": "The adapter allows to send and receive MQTT messages from ioBroker and to be a broker.",
4
- "version": "2.5.1",
4
+ "version": "2.5.7",
5
5
  "author": "bluefox <dogafox@gmail.com>",
6
6
  "homepage": "https://github.com/ioBroker/ioBroker.sonoff",
7
7
  "repository": {
@@ -17,25 +17,37 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "mqtt-connection": "^4.1.0",
20
- "@iobroker/adapter-core": "^2.6.0"
20
+ "@iobroker/adapter-core": "^2.6.8"
21
21
  },
22
22
  "devDependencies": {
23
- "@alcalzone/release-script": "^3.5.6",
24
- "@alcalzone/release-script-plugin-iobroker": "^3.5.7",
25
- "@alcalzone/release-script-plugin-license": "^3.5.3",
26
- "axios": "^0.26.1",
23
+ "@alcalzone/release-script": "^3.6.0",
24
+ "@alcalzone/release-script-plugin-iobroker": "^3.6.0",
25
+ "@alcalzone/release-script-plugin-license": "^3.5.9",
26
+ "@iobroker/legacy-testing": "^0.3.6",
27
+ "axios": "^1.4.0",
27
28
  "mqtt": "^4.3.7",
28
29
  "gulp": "^4.0.2",
29
- "mocha": "^9.2.2",
30
- "chai": "^4.3.6"
30
+ "mocha": "^10.2.0",
31
+ "chai": "^4.3.7"
31
32
  },
32
33
  "bugs": {
33
34
  "url": "https://github.com/ioBroker/ioBroker.sonoff/issues"
34
35
  },
35
36
  "main": "main.js",
37
+ "files": [
38
+ "main.js",
39
+ "admin/",
40
+ "lib/",
41
+ "io-package.json",
42
+ "LICENSE"
43
+ ],
36
44
  "scripts": {
37
45
  "test": "node node_modules/mocha/bin/mocha --exit",
38
- "release": "release-script"
46
+ "release": "release-script",
47
+ "release-patch": "release-script patch --yes",
48
+ "release-minor": "release-script minor --yes",
49
+ "release-major": "release-script major --yes",
50
+ "update-packages": "ncu --upgrade"
39
51
  },
40
52
  "engines": {
41
53
  "node": ">=4.0.0"
@@ -1,37 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Something is not working as it should
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
- ---
8
-
9
- **Check if the Bug maybe is with Amazon**
10
- The adapter is using the same API as the Alexa mobile App. This means:
11
- * If you can not do this what you want with the App then the Adapter also can not do it!
12
- * Also if the App can do it please test if the same effect then the bug also happens with the App (e.g. a speak command do not work on a certain device ... can you do a speak via Alexa App? If not - Amazon problem!)
13
-
14
- **Describe the bug**
15
- A clear and concise description of what the bug is. Especially describe what you verified using the Alexa App (see above).
16
-
17
- **To Reproduce**
18
- Steps to reproduce the behavior:
19
- 1. Go to '...'
20
- 2. Click on '...'
21
- 3. Scroll down to '....'
22
- 4. See error
23
-
24
- **Expected behavior**
25
- A clear and concise description of what you expected to happen.
26
-
27
- **Screenshots & Logfiles**
28
- If applicable, add screenshots and logfiles to help explain your problem.
29
-
30
- **Versions:**
31
- - Adapter version: <adapter-version>
32
- - JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
33
- - Node version: <node-version> <!-- determine this with `node -v` on the console -->
34
- - Operating system: <os-name>
35
-
36
- **Additional context**
37
- Add any other context about the problem here.
@@ -1,24 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
- **Consider the Reality**
10
- The adapter is using the same API as the Alexa mobile App. This means:
11
-
12
- If you can not do this what you want with the App then the Adapter also can not do it! Also a feature rewuest most likely will not be possible.
13
-
14
- **Is your feature request related to a problem? Please describe.**
15
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
16
-
17
- **Describe the solution you'd like**
18
- A clear and concise description of what you want to happen.
19
-
20
- **Describe alternatives you've considered**
21
- A clear and concise description of any alternative solutions or features you've considered.
22
-
23
- **Additional context**
24
- Add any other context or screenshots about the feature request here.
@@ -1,17 +0,0 @@
1
- # Configure here which dependency updates should be merged automatically.
2
- # The recommended configuration is the following:
3
- - match:
4
- # Only merge patches for production dependencies
5
- dependency_type: production
6
- update_type: "semver:patch"
7
- - match:
8
- # Except for security fixes, here we allow minor patches
9
- dependency_type: production
10
- update_type: "security:minor"
11
- - match:
12
- # and development dependencies can have a minor update, too
13
- dependency_type: development
14
- update_type: "semver:minor"
15
-
16
- # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
17
- # https://dependabot.com/docs/config-file/#automerged_updates
@@ -1,16 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: github-actions
4
- directory: "/"
5
- schedule:
6
- interval: monthly
7
- time: "04:00"
8
- timezone: Europe/Berlin
9
- - package-ecosystem: npm
10
- directory: "/"
11
- schedule:
12
- interval: monthly
13
- time: "04:00"
14
- timezone: Europe/Berlin
15
- open-pull-requests-limit: 20
16
- versioning-strategy: increase
package/.github/stale.yml DELETED
@@ -1,78 +0,0 @@
1
- # Configuration for probot-stale - https://github.com/probot/stale
2
-
3
- # Number of days of inactivity before an Issue or Pull Request becomes stale
4
- daysUntilStale: 90
5
-
6
- # Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7
- # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8
- daysUntilClose: 7
9
-
10
- # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11
- onlyLabels: []
12
-
13
- # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14
- exemptLabels:
15
- - enhancement
16
- - security
17
-
18
- # Set to true to ignore issues in a project (defaults to false)
19
- exemptProjects: true
20
-
21
- # Set to true to ignore issues in a milestone (defaults to false)
22
- exemptMilestones: true
23
-
24
- # Set to true to ignore issues with an assignee (defaults to false)
25
- exemptAssignees: false
26
-
27
- # Label to use when marking as stale
28
- staleLabel: wontfix
29
-
30
- # Comment to post when marking as stale. Set to `false` to disable
31
- markComment: >
32
- This issue has been automatically marked as stale because it has not had
33
- recent activity. It will be closed if no further activity occurs within the next 7 days.
34
- Please check if the issue is still relevant in the most current version of the adapter
35
- and tell us. Also check that all relevant details, logs and reproduction steps
36
- are included and update them if needed.
37
- Thank you for your contributions.
38
-
39
- Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab.
40
- Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden.
41
- Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist,
42
- und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte
43
- enthalten sind bzw. aktualisiert diese.
44
- Vielen Dank für Eure Unterstützung.
45
-
46
- # Comment to post when removing the stale label.
47
- # unmarkComment: >
48
- # Your comment here.
49
-
50
- # Comment to post when closing a stale Issue or Pull Request.
51
- closeComment: >
52
- This issue has been automatically closed because of inactivity. Please open a new
53
- issue if still relevant and make sure to include all relevant details, logs and
54
- reproduction steps.
55
- Thank you for your contributions.
56
-
57
- Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein
58
- neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details,
59
- Logs und Reproduktionsschritte enthalten sind.
60
- Vielen Dank für Eure Unterstützung.
61
-
62
- # Limit the number of actions per hour, from 1-30. Default is 30
63
- limitPerRun: 30
64
-
65
- # Limit to only `issues` or `pulls`
66
- only: issues
67
-
68
- # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
69
- # pulls:
70
- # daysUntilStale: 30
71
- # markComment: >
72
- # This pull request has been automatically marked as stale because it has not had
73
- # recent activity. It will be closed if no further activity occurs. Thank you
74
- # for your contributions.
75
-
76
- # issues:
77
- # exemptLabels:
78
- # - confirmed