Skip to content

Commit e1f5bd6

Browse files
committed
used @iobroker/eslint-config
1 parent 47f0213 commit e1f5bd6

20 files changed

+848
-690
lines changed

.releaseconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"plugins": ["iobroker", "license"]
2+
"plugins": ["iobroker", "license"]
33
}

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ You can deactivate HTTPS and authentication on this web instance, but better is
7878
### **WORK IN PROGRESS**
7979
* (bluefox) updated socket classes
8080
* (bluefox) minimum required node.js version is 18
81+
* (bluefox) used `@iobroker/eslint-config`
8182

8283
### 5.0.1 (2024-02-22)
8384
* (bluefox) updated socket classes and fixed vis-2 error if connected via cloud
@@ -318,7 +319,7 @@ You can deactivate HTTPS and authentication on this web instance, but better is
318319
### 0.3.3 (2017-01-02)
319320
* (bluefox) Fix error with smartNames
320321
* (bluefox) Take the superset of actions for group and not the last one
321-
* (bluefox) if group has switches and dimmers, turn devices OFF if the percent level is less than 30%
322+
* (bluefox) if a group has switches and dimmers, turn devices OFF if the percent level is less than 30%
322323
* (bluefox) Remember ON level for dimmers to switch it later ON
323324

324325
### 0.3.0 (2016-12-29)

admin/actions.js

+68-47
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,68 @@
1-
function getActions(obj) {
2-
var type = obj.common.type;
3-
var actions = null;
4-
5-
if (obj.common.write === false) {
6-
if (obj.common.unit === 'C' || obj.common.unit === 'C°' || obj.common.unit === '°C' ||
7-
obj.common.unit === 'F' || obj.common.unit === 'F°' || obj.common.unit === '°F' ||
8-
obj.common.unit === 'K' || obj.common.unit === 'K°' || obj.common.unit === '°K') {
9-
actions = ['getTemperatureReading'];
10-
type = '';
11-
} else {
12-
return null;
13-
}
14-
} else {
15-
if (type === 'number') {
16-
if ((obj.common.unit === 'C' || obj.common.unit === 'C°' || obj.common.unit === '°C' ||
17-
obj.common.unit === 'F' || obj.common.unit === 'F°' || obj.common.unit === '°F' ||
18-
obj.common.unit === 'K' || obj.common.unit === 'K°' || obj.common.unit === '°K')
19-
&& obj.common.role !== "level.color.temperature") {
20-
actions = ['setTargetTemperature', 'incrementTargetTemperature', 'decrementTargetTemperature', 'getTargetTemperature'];
21-
type = '';
22-
} else if (obj.common.role === 'level.color.hue') {
23-
actions = ['setColor', 'turnOn', 'turnOff'];
24-
} else if (obj.common.role === 'level.color.temperature') {
25-
actions = ['incrementColorTemperature', 'decrementColorTemperature', 'setColorTemperature'];
26-
} else {
27-
actions = ['setPercentage', 'incrementPercentage', 'decrementPercentage', 'turnOn', 'turnOff'];
28-
}
29-
} else if (obj.common.role === 'switch.lock') {
30-
actions = ['setLockState', 'getLockState'];
31-
type = '';
32-
} else if (obj.common.role && obj.common.role.match(/^button/)) {
33-
actions = ['turnOn'];
34-
type = '';
35-
} else if (obj.common.role === 'level.color.rgb') {
36-
actions = ['setColor', 'turnOn', 'turnOff'];
37-
} else {
38-
actions = ['turnOn', 'turnOff'];
39-
type = '';
40-
}
41-
}
42-
return {type: type, actions: actions};
43-
}
44-
45-
if (typeof module !== 'undefined' && module.parent) {
46-
module.exports.getActions = getActions;
47-
}
1+
function getActions(obj) {
2+
let type = obj.common.type;
3+
let actions = null;
4+
5+
if (obj.common.write === false) {
6+
if (
7+
obj.common.unit === 'C' ||
8+
obj.common.unit === 'C°' ||
9+
obj.common.unit === '°C' ||
10+
obj.common.unit === 'F' ||
11+
obj.common.unit === 'F°' ||
12+
obj.common.unit === '°F' ||
13+
obj.common.unit === 'K' ||
14+
obj.common.unit === 'K°' ||
15+
obj.common.unit === '°K'
16+
) {
17+
actions = ['getTemperatureReading'];
18+
type = '';
19+
} else {
20+
return null;
21+
}
22+
} else {
23+
if (type === 'number') {
24+
if (
25+
(obj.common.unit === 'C' ||
26+
obj.common.unit === 'C°' ||
27+
obj.common.unit === '°C' ||
28+
obj.common.unit === 'F' ||
29+
obj.common.unit === 'F°' ||
30+
obj.common.unit === '°F' ||
31+
obj.common.unit === 'K' ||
32+
obj.common.unit === 'K°' ||
33+
obj.common.unit === '°K') &&
34+
obj.common.role !== 'level.color.temperature'
35+
) {
36+
actions = [
37+
'setTargetTemperature',
38+
'incrementTargetTemperature',
39+
'decrementTargetTemperature',
40+
'getTargetTemperature',
41+
];
42+
type = '';
43+
} else if (obj.common.role === 'level.color.hue') {
44+
actions = ['setColor', 'turnOn', 'turnOff'];
45+
} else if (obj.common.role === 'level.color.temperature') {
46+
actions = ['incrementColorTemperature', 'decrementColorTemperature', 'setColorTemperature'];
47+
} else {
48+
actions = ['setPercentage', 'incrementPercentage', 'decrementPercentage', 'turnOn', 'turnOff'];
49+
}
50+
} else if (obj.common.role === 'switch.lock') {
51+
actions = ['setLockState', 'getLockState'];
52+
type = '';
53+
} else if (obj.common.role && obj.common.role.match(/^button/)) {
54+
actions = ['turnOn'];
55+
type = '';
56+
} else if (obj.common.role === 'level.color.rgb') {
57+
actions = ['setColor', 'turnOn', 'turnOff'];
58+
} else {
59+
actions = ['turnOn', 'turnOff'];
60+
type = '';
61+
}
62+
}
63+
return { type: type, actions: actions };
64+
}
65+
66+
if (typeof module !== 'undefined' && module.parent) {
67+
module.exports.getActions = getActions;
68+
}

admin/i18n/de/translations.json admin/i18n/de.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"Add device": "Gerät hinzufügen",
77
"Add service": "Dienst hinzufügen",
88
"Addresses": "Adressen",
9+
"Allow admin access": "Administratorzugriff zulassen",
910
"Allow admin access (only pro)": "Erlaube Zugriff auf Admin (nur pro)",
11+
"Allow lovelace access": "Zugang zum lovelace ",
1012
"Allow self-signed certificates": "Erlaube selbst-signierte Zertifikate",
1113
"Are you sure?": "Sind Sie sicher?",
1214
"Authentication must be disabled. You can create second instance extra for cloud.": "Die Authentifizierung muss deaktiviert sein. Sie können zweite Instanz extra für Cloud erstellen.",
@@ -28,25 +30,29 @@
2830
"Filter: ": "Filter: ",
2931
"Functions": "Funktionen",
3032
"IFTTT key": "IFTTT key",
33+
"Instance": "Instanz",
3134
"Instance does not exists": "Instanz existiert nicht",
3235
"Instance is not active.": "Instanz ist nicht aktiv.",
3336
"Instance must run to deliver the data": "Die Instanz muss laufen um die Daten zu liefern",
34-
"Instance": "Instanz",
3537
"Invalid object": "Ungültiges Objekt",
3638
"Language": "Sprache",
39+
"Login": "Login",
3740
"OFF level for switches": "Aus-Pegel für Schalter",
3841
"Off": "aus",
3942
"Ok": "Ok",
4043
"On": "an",
4144
"Options": "Einstellungen",
45+
"Password": "Passwort",
4246
"Personal settings (only pro)": "Eigene Einstellungen (nur pro)",
4347
"Ping timeout": "Ping-Timeout(ms)",
4448
"Place function in names first": "Platziere Funktionsnamen vorne",
49+
"Read more about certificates": "Mehr zu Zertifikaten",
4550
"Replace in names": "Ersetze in Namen",
4651
"Restart on disconnect": "Neustart bei Verbindungsabbruch",
4752
"Rooms": "Räume",
4853
"Save settings and the names will be changed": "Speichere die Einstellungen um die neuen Namen zu sehen",
4954
"Select": "Wählen",
55+
"Server": "Server",
5056
"Service names": "Servicenamen",
5157
"Services and IFTTT": "Services und IFTTT",
5258
"Smart Devices": "Smart Geräte",
@@ -58,7 +64,9 @@
5864
"Types": "Typen",
5965
"Use following link for IFTTT": "Benutze folgenden Link für IFTTT",
6066
"Use following link for custom service": "Benutze folgende Link für einen eigenen Service",
67+
"Use login and password": "Login und Passwort verwenden ",
6168
"Use text2command instance": "Benutze text2command Instanz",
69+
"Web instance": "Webinstanz",
6270
"White list for services": "White list für Services",
6371
"Write response to": "Schreibe Antwort ins",
6472
"amazon link": "Falls du den Alexa Skill benutzt, schreibe doch bitte <a href='http://alexa.amazon.de/spa/index.html#skills/dp/B074LXQQQT/create-review/?ref-suffix=war_dp' target='_blank' class='here'>hier</a> eine Review.<br>Beispiele kann man <a href='http://alexa.amazon.de/spa/index.html#skills/dp/B01MRXCC3J/reviews' target='_blank'>hier</a> anschauen.",
@@ -72,6 +80,7 @@
7280
"last value": "letzter Wert",
7381
"modified": "Der Name wurde vom Anwender geändert",
7482
"no type": "kein Typ",
83+
"only on pro": "nur auf pro",
7584
"tooltip_allowSelfSignedCertificate": "Wenn man eine eigene Cloud verwendet, man kann die Benutzung von selbst-signierten Zertifikaten erlauben.",
7685
"tooltip_apikey": "Dieser Schlüssel wird benötigt um mit der Cloud zu kommunizieren. Man kann den Schlüssel unter https://iobroker.net bekommen. Es sieht wie folgt aus nickname_f1f439a0-001a-11e7-bc64-92361f002671",
7786
"tooltip_cloudUrl": "Normalerweise muss diese Option nicht geändert werden. Dies ist nur notwendig, wenn man eigenen Cloud verwendet.",
@@ -82,13 +91,5 @@
8291
"tooltip_language": "Man kann hier die Sprache definieren um zwischen US Alexa Skill und DE Alexa Skill umschalten zu können",
8392
"tooltip_noCommon": "Wenn diese Option aktiviert wird, so werden die Einstellungen nur für diese Instanz gespeichert. So ist es möglich in einer anderen Instanz andere Namen zu setzen.",
8493
"tooltip_responseOID": "Für jedes Kommando wird eine Textantwort generiert. Hier kannst du die Objekt ID angeben, an welche die Textantwort gesendet werden soll, z.B. sayit.0.tts.text.",
85-
"tooltip_restartOnDisconnect": "Workaround für fehlende Kommunikation mit Alexa nach Verbindungsabbruch. Damit kann man zwingen den Adapter neu zu starten und das Problem umgehen.",
86-
"Password": "Passwort",
87-
"Login": "Login",
88-
"Server": "Server",
89-
"Use login and password": "Login und Passwort verwenden ",
90-
"only on pro": "nur auf pro",
91-
"Allow admin access": "Administratorzugriff zulassen",
92-
"Allow lovelace access": "Zugang zum lovelace ",
93-
"Web instance": "Webinstanz"
94+
"tooltip_restartOnDisconnect": "Workaround für fehlende Kommunikation mit Alexa nach Verbindungsabbruch. Damit kann man zwingen den Adapter neu zu starten und das Problem umgehen."
9495
}

admin/i18n/en/translations.json admin/i18n/en.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"Add device": "Add device",
77
"Add service": "Add service",
88
"Addresses": "Addresses",
9+
"Allow admin access": "Allow admin access",
910
"Allow admin access (only pro)": "Allow admin access (only pro)",
11+
"Allow lovelace access": "Allow lovelace access",
1012
"Allow self-signed certificates": "Allow self-signed certificates",
1113
"Are you sure?": "Are you sure?",
1214
"Authentication must be disabled. You can create second instance extra for cloud.": "Authentication must be disabled. You can create a second instance extra for the cloud.",
@@ -28,25 +30,29 @@
2830
"Filter: ": "Filter: ",
2931
"Functions": "Functions",
3032
"IFTTT key": "IFTTT key",
33+
"Instance": "Instance",
3134
"Instance does not exists": "Instance does not exists",
3235
"Instance is not active.": "Instance is not active.",
3336
"Instance must run to deliver the data": "The instance must run to deliver the data",
34-
"Instance": "Instance",
3537
"Invalid object": "Invalid object",
3638
"Language": "Language",
39+
"Login": "Login",
3740
"OFF level for switches": "OFF level for switches",
3841
"Off": "off",
3942
"Ok": "Ok",
4043
"On": "on",
4144
"Options": "Options",
45+
"Password": "Password",
4246
"Personal settings (only pro)": "Personal settings (only pro)",
4347
"Ping timeout": "Ping timeout(ms)",
4448
"Place function in names first": "Place function in names first",
49+
"Read more about certificates": "Read more about certificates",
4550
"Replace in names": "Replace in names",
4651
"Restart on disconnect": "Restart on disconnect",
4752
"Rooms": "Rooms",
4853
"Save settings and the names will be changed": "Save settings and the names will be changed",
4954
"Select": "Select",
55+
"Server": "Server",
5056
"Service names": "Service names",
5157
"Services and IFTTT": "Services and IFTTT",
5258
"Smart Devices": "Smart Devices",
@@ -58,7 +64,9 @@
5864
"Types": "Types",
5965
"Use following link for IFTTT": "Use following link for IFTTT",
6066
"Use following link for custom service": "Use following link for custom service",
67+
"Use login and password": "Use login and password",
6168
"Use text2command instance": "Use text2command instance",
69+
"Web instance": "Web instance",
6270
"White list for services": "White list for services",
6371
"Write response to": "Write response to",
6472
"amazon link": "If you use the Alexa Skill, please write a review for us <a href='http://alexa.amazon.de/spa/index.html#skills/dp/B074LXQQQT/create-review/?ref-suffix=war_dp' target='_blank' class='here'>here</a>.<br>Examples can be found <a href='http://alexa.amazon.de/spa/index.html#skills/dp/B01MRXCC3J/reviews' target='_blank'>here</a>.",
@@ -72,6 +80,7 @@
7280
"last value": "last value",
7381
"modified": "Name was modified by user",
7482
"no type": "no type",
83+
"only on pro": "only on pro",
7584
"tooltip_allowSelfSignedCertificate": "If you use your own cloud, you can allow the use of self-signed certificates for the cloud.",
7685
"tooltip_apikey": "This key is required to communicate with a cloud. You can get the API-KEY on https://iobroker.net and it looks like nickname_f1f439a0-001a-11e7-bc64-92361f002671",
7786
"tooltip_cloudUrl": "Normally you do not need to change it. Only required if you plan to use your own cloud.",
@@ -82,13 +91,5 @@
8291
"tooltip_language": "You can define the languages to switch fast between US Alexa Skill and DE Alexa Skill.",
8392
"tooltip_noCommon": "If enabled, the settings will be stored only for this instance. So in the another instance the other names could be set.",
8493
"tooltip_responseOID": "For every command the text response will be generated. You can define here the Object ID , where this text must be written to. E.g. sayit.0.tts.text.",
85-
"tooltip_restartOnDisconnect": "Workaround for missing connection to Alexa after the connection to cloud was lost. With this option you can restart adapter after each disconnection and it will work.",
86-
"Password": "Password",
87-
"Login": "Login",
88-
"Server": "Server",
89-
"Use login and password": "Use login and password",
90-
"only on pro": "only on pro",
91-
"Allow admin access": "Allow admin access",
92-
"Allow lovelace access": "Allow lovelace access",
93-
"Web instance": "Web instance"
94+
"tooltip_restartOnDisconnect": "Workaround for missing connection to Alexa after the connection to cloud was lost. With this option you can restart adapter after each disconnection and it will work."
9495
}

admin/i18n/es/translations.json admin/i18n/es.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"Add device": "Añadir dispositivo",
77
"Add service": "Añadir servicio",
88
"Addresses": "Direcciones",
9+
"Allow admin access": "Permitir acceso de administrador",
910
"Allow admin access (only pro)": "Permitir acceso de administrador (solo pro)",
11+
"Allow lovelace access": "Permitir el acceso a Lovelace",
1012
"Allow self-signed certificates": "Permitir certificados autofirmados",
1113
"Are you sure?": "¿Estás seguro?",
1214
"Authentication must be disabled. You can create second instance extra for cloud.": "La autenticación debe estar deshabilitada. Puede crear una segunda instancia extra para la nube.",
@@ -28,25 +30,29 @@
2830
"Filter: ": "Filtrar",
2931
"Functions": "Funciones",
3032
"IFTTT key": "Tecla IFTTT",
33+
"Instance": "Ejemplo",
3134
"Instance does not exists": "La instancia no existe",
3235
"Instance is not active.": "La instancia no está activa.",
3336
"Instance must run to deliver the data": "La instancia debe ejecutarse para entregar los datos",
34-
"Instance": "Ejemplo",
3537
"Invalid object": "Objeto inválido",
3638
"Language": "Idioma",
39+
"Login": "Login",
3740
"OFF level for switches": "Nivel de apagado para interruptores",
3841
"Off": "apagado",
3942
"Ok": "De acuerdo",
4043
"On": "en",
4144
"Options": "Opciones",
45+
"Password": "Contraseña",
4246
"Personal settings (only pro)": "Configuración personal (solo pro)",
4347
"Ping timeout": "Tiempo de espera de ping (ms)",
4448
"Place function in names first": "Coloque la función en los nombres primero",
49+
"Read more about certificates": "Leer más sobre los certificados",
4550
"Replace in names": "Reemplazar en nombres",
4651
"Restart on disconnect": "Reiniciar al desconectar",
4752
"Rooms": "Habitaciones",
4853
"Save settings and the names will be changed": "Guarde la configuración y los nombres serán cambiados",
4954
"Select": "Seleccionar",
55+
"Server": "Servidor",
5056
"Service names": "Nombres de servicio",
5157
"Services and IFTTT": "Servicios e IFTTT",
5258
"Smart Devices": "Dispositivos inteligentes",
@@ -58,7 +64,9 @@
5864
"Types": "Tipos",
5965
"Use following link for IFTTT": "Utilice el siguiente enlace para IFTTT",
6066
"Use following link for custom service": "Use el siguiente enlace para servicio personalizado",
67+
"Use login and password": "Utilice nombre de usuario y contraseña",
6168
"Use text2command instance": "Use la instancia del comando text2",
69+
"Web instance": "Instancia web",
6270
"White list for services": "Lista blanca de servicios",
6371
"Write response to": "Escribir respuesta a",
6472
"amazon link": "Si usa Alexa Skill, escriba una opinión para nosotros <a href = 'http: //alexa.amazon.de/spa/index.html#skills/dp/B074LXQQQT/create-review/? Ref-suffix = war_dp 'target =' _ blank 'class =' ​​here '> aquí </a>.<br>Se pueden encontrar ejemplos <a href='http://alexa.amazon.de/spa/index.html#skills/dp/B01MRXCC3J/reviews' target='blank'> aquí </a>.",
@@ -72,6 +80,7 @@
7280
"last value": "último valor",
7381
"modified": "El nombre fue modificado por el usuario",
7482
"no type": "Sin tipo",
83+
"only on pro": "solo en pro",
7584
"tooltip_allowSelfSignedCertificate": "Si usa su propia nube, puede permitir el uso de certificados autofirmados para la nube.",
7685
"tooltip_apikey": "Esta clave es necesaria para comunicarse con una nube. Puede obtener la API-KEY en https://iobroker.net y se ve como nickname_f1f439a0-001a-11e7-bc64-92361f002671",
7786
"tooltip_cloudUrl": "Normalmente no es necesario cambiarlo. Solo es obligatorio si planea usar su propia nube.",
@@ -82,13 +91,5 @@
8291
"tooltip_language": "Puede definir los idiomas para cambiar rápidamente entre US Alexa Skill y DE Alexa Skill.",
8392
"tooltip_noCommon": "Si está habilitado, la configuración se almacenará solo para esta instancia. Entonces, en la otra instancia, se podrían establecer los otros nombres.",
8493
"tooltip_responseOID": "Para cada comando, se generará la respuesta de texto. Aquí puede definir la ID del objeto, donde debe escribirse este texto. P.ej. sayit.0.tts.text.",
85-
"tooltip_restartOnDisconnect": "Solución alternativa para la conexión faltante a Alexa después de la conexión a la nube se perdió. Con esta opción, puede reiniciar el adaptador después de cada desconexión y funcionará.",
86-
"Password": "Contraseña",
87-
"Login": "Login",
88-
"Server": "Servidor",
89-
"Use login and password": "Utilice nombre de usuario y contraseña",
90-
"only on pro": "solo en pro",
91-
"Allow admin access": "Permitir acceso de administrador",
92-
"Allow lovelace access": "Permitir el acceso a Lovelace",
93-
"Web instance": "Instancia web"
94+
"tooltip_restartOnDisconnect": "Solución alternativa para la conexión faltante a Alexa después de la conexión a la nube se perdió. Con esta opción, puede reiniciar el adaptador después de cada desconexión y funcionará."
9495
}

0 commit comments

Comments
 (0)