kiosko-plugin-homeassistant 0.2.3 → 0.2.5
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/dist/index.js +350 -279
- package/kiosko-manifest.json +501 -126
- package/package.json +9 -2
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createRequire as __pluginRequire } from 'node:module'; const require =
|
|
|
4
4
|
import { defineSource, definePlugin, defineWidget as defineWidget5, drawEmpty, listLayout, listOptions, t as t5 } from "@kiosko/sdk";
|
|
5
5
|
|
|
6
6
|
// src/ha.ts
|
|
7
|
-
import { matchFilter, filterPatterns } from "@kiosko/sdk";
|
|
7
|
+
import { localize, matchFilter, filterPatterns } from "@kiosko/sdk";
|
|
8
8
|
function energyStats(prefs) {
|
|
9
9
|
const out = { gridIn: [], gridOut: [], solar: [], batteryIn: [], batteryOut: [], power: {} };
|
|
10
10
|
const sources = prefs?.energy_sources;
|
|
@@ -132,94 +132,94 @@ function withUnit(text, unit) {
|
|
|
132
132
|
}
|
|
133
133
|
var on_off = (on, off) => ({ on, off });
|
|
134
134
|
var BINARY = {
|
|
135
|
-
battery: on_off({ en: "Low", es: "Baja" }, { en: "Normal", es: "Normal" }),
|
|
136
|
-
battery_charging: on_off({ en: "Charging", es: "Cargando" }, { en: "Not charging", es: "Sin cargar" }),
|
|
137
|
-
carbon_monoxide: on_off({ en: "CO detected", es: "CO detectado" }, { en: "Clear", es: "Normal" }),
|
|
138
|
-
cold: on_off({ en: "Cold", es: "Fr\xEDo" }, { en: "Normal", es: "Normal" }),
|
|
139
|
-
connectivity: on_off({ en: "Connected", es: "Conectado" }, { en: "Disconnected", es: "Desconectado" }),
|
|
140
|
-
door: on_off({ en: "Open", es: "Abierta" }, { en: "Closed", es: "Cerrada" }),
|
|
141
|
-
garage_door: on_off({ en: "Open", es: "Abierta" }, { en: "Closed", es: "Cerrada" }),
|
|
142
|
-
gas: on_off({ en: "Gas detected", es: "Gas detectado" }, { en: "Clear", es: "Normal" }),
|
|
143
|
-
heat: on_off({ en: "Hot", es: "Calor" }, { en: "Normal", es: "Normal" }),
|
|
144
|
-
light: on_off({ en: "Light", es: "Luz" }, { en: "Dark", es: "Oscuro" }),
|
|
145
|
-
lock: on_off({ en: "Unlocked", es: "Sin cerrojo" }, { en: "Locked", es: "Con cerrojo" }),
|
|
146
|
-
moisture: on_off({ en: "Wet", es: "Agua" }, { en: "Dry", es: "Seco" }),
|
|
147
|
-
motion: on_off({ en: "Motion", es: "Movimiento" }, { en: "Clear", es: "Sin movimiento" }),
|
|
148
|
-
moving: on_off({ en: "Moving", es: "Movi\xE9ndose" }, { en: "Still", es: "Quieto" }),
|
|
149
|
-
occupancy: on_off({ en: "Occupied", es: "Ocupado" }, { en: "Clear", es: "Libre" }),
|
|
150
|
-
opening: on_off({ en: "Open", es: "Abierto" }, { en: "Closed", es: "Cerrado" }),
|
|
151
|
-
plug: on_off({ en: "Plugged in", es: "Enchufado" }, { en: "Unplugged", es: "Desenchufado" }),
|
|
152
|
-
power: on_off({ en: "Power", es: "Con corriente" }, { en: "No power", es: "Sin corriente" }),
|
|
153
|
-
presence: on_off({ en: "Home", es: "En casa" }, { en: "Away", es: "Fuera" }),
|
|
154
|
-
problem: on_off({ en: "Problem", es: "Problema" }, { en: "OK", es: "Correcto" }),
|
|
155
|
-
running: on_off({ en: "Running", es: "En marcha" }, { en: "Not running", es: "Parado" }),
|
|
156
|
-
safety: on_off({ en: "Unsafe", es: "Peligro" }, { en: "Safe", es: "Seguro" }),
|
|
157
|
-
smoke: on_off({ en: "Smoke", es: "Humo" }, { en: "Clear", es: "Normal" }),
|
|
158
|
-
sound: on_off({ en: "Sound", es: "Sonido" }, { en: "Quiet", es: "Silencio" }),
|
|
159
|
-
tamper: on_off({ en: "Tampered", es: "Manipulado" }, { en: "Clear", es: "Normal" }),
|
|
160
|
-
update: on_off({ en: "Update available", es: "Actualizaci\xF3n disponible" }, { en: "Up to date", es: "Al d\xEDa" }),
|
|
161
|
-
vibration: on_off({ en: "Vibration", es: "Vibraci\xF3n" }, { en: "Still", es: "Quieto" }),
|
|
162
|
-
window: on_off({ en: "Open", es: "Abierta" }, { en: "Closed", es: "Cerrada" })
|
|
135
|
+
battery: on_off({ en: "Low", es: "Baja", de: "Schwach", "zh-Hant": "\u96FB\u91CF\u4F4E", "zh-Hans": "\u7535\u91CF\u4F4E" }, { en: "Normal", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
136
|
+
battery_charging: on_off({ en: "Charging", es: "Cargando", de: "L\xE4dt", "zh-Hant": "\u5145\u96FB\u4E2D", "zh-Hans": "\u5145\u7535\u4E2D" }, { en: "Not charging", es: "Sin cargar", de: "L\xE4dt nicht", "zh-Hant": "\u672A\u5145\u96FB", "zh-Hans": "\u672A\u5145\u7535" }),
|
|
137
|
+
carbon_monoxide: on_off({ en: "CO detected", es: "CO detectado", de: "CO erkannt", "zh-Hant": "\u5075\u6E2C\u5230 CO", "zh-Hans": "\u68C0\u6D4B\u5230 CO" }, { en: "Clear", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
138
|
+
cold: on_off({ en: "Cold", es: "Fr\xEDo", de: "Kalt", "zh-Hant": "\u5BD2\u51B7", "zh-Hans": "\u5BD2\u51B7" }, { en: "Normal", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
139
|
+
connectivity: on_off({ en: "Connected", es: "Conectado", de: "Verbunden", "zh-Hant": "\u5DF2\u9023\u7DDA", "zh-Hans": "\u5DF2\u8FDE\u63A5" }, { en: "Disconnected", es: "Desconectado", de: "Getrennt", "zh-Hant": "\u5DF2\u4E2D\u65B7\u9023\u7DDA", "zh-Hans": "\u5DF2\u65AD\u5F00" }),
|
|
140
|
+
door: on_off({ en: "Open", es: "Abierta", de: "Offen", "zh-Hant": "\u5DF2\u958B\u555F", "zh-Hans": "\u5DF2\u6253\u5F00" }, { en: "Closed", es: "Cerrada", de: "Geschlossen", "zh-Hant": "\u5DF2\u95DC\u9589", "zh-Hans": "\u5DF2\u5173\u95ED" }),
|
|
141
|
+
garage_door: on_off({ en: "Open", es: "Abierta", de: "Offen", "zh-Hant": "\u5DF2\u958B\u555F", "zh-Hans": "\u5DF2\u6253\u5F00" }, { en: "Closed", es: "Cerrada", de: "Geschlossen", "zh-Hant": "\u5DF2\u95DC\u9589", "zh-Hans": "\u5DF2\u5173\u95ED" }),
|
|
142
|
+
gas: on_off({ en: "Gas detected", es: "Gas detectado", de: "Gas erkannt", "zh-Hant": "\u5075\u6E2C\u5230\u74E6\u65AF", "zh-Hans": "\u68C0\u6D4B\u5230\u71C3\u6C14" }, { en: "Clear", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
143
|
+
heat: on_off({ en: "Hot", es: "Calor", de: "Hei\xDF", "zh-Hant": "\u904E\u71B1", "zh-Hans": "\u8FC7\u70ED" }, { en: "Normal", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
144
|
+
light: on_off({ en: "Light", es: "Luz", de: "Hell", "zh-Hant": "\u660E\u4EAE", "zh-Hans": "\u660E\u4EAE" }, { en: "Dark", es: "Oscuro", de: "Dunkel", "zh-Hant": "\u9ED1\u6697", "zh-Hans": "\u9ED1\u6697" }),
|
|
145
|
+
lock: on_off({ en: "Unlocked", es: "Sin cerrojo", de: "Entriegelt", "zh-Hant": "\u5DF2\u89E3\u9396", "zh-Hans": "\u5DF2\u89E3\u9501" }, { en: "Locked", es: "Con cerrojo", de: "Verriegelt", "zh-Hant": "\u5DF2\u4E0A\u9396", "zh-Hans": "\u5DF2\u4E0A\u9501" }),
|
|
146
|
+
moisture: on_off({ en: "Wet", es: "Agua", de: "Nass", "zh-Hant": "\u6709\u6C34", "zh-Hans": "\u6709\u6C34" }, { en: "Dry", es: "Seco", de: "Trocken", "zh-Hant": "\u4E7E\u71E5", "zh-Hans": "\u5E72\u71E5" }),
|
|
147
|
+
motion: on_off({ en: "Motion", es: "Movimiento", de: "Bewegung", "zh-Hant": "\u6709\u52D5\u975C", "zh-Hans": "\u6709\u52A8\u9759" }, { en: "Clear", es: "Sin movimiento", de: "Keine Bewegung", "zh-Hant": "\u7121\u52D5\u975C", "zh-Hans": "\u65E0\u52A8\u9759" }),
|
|
148
|
+
moving: on_off({ en: "Moving", es: "Movi\xE9ndose", de: "Bewegt sich", "zh-Hant": "\u79FB\u52D5\u4E2D", "zh-Hans": "\u79FB\u52A8\u4E2D" }, { en: "Still", es: "Quieto", de: "Still", "zh-Hant": "\u975C\u6B62", "zh-Hans": "\u9759\u6B62" }),
|
|
149
|
+
occupancy: on_off({ en: "Occupied", es: "Ocupado", de: "Belegt", "zh-Hant": "\u6709\u4EBA", "zh-Hans": "\u6709\u4EBA" }, { en: "Clear", es: "Libre", de: "Frei", "zh-Hant": "\u7121\u4EBA", "zh-Hans": "\u65E0\u4EBA" }),
|
|
150
|
+
opening: on_off({ en: "Open", es: "Abierto", de: "Offen", "zh-Hant": "\u5DF2\u958B\u555F", "zh-Hans": "\u5DF2\u6253\u5F00" }, { en: "Closed", es: "Cerrado", de: "Geschlossen", "zh-Hant": "\u5DF2\u95DC\u9589", "zh-Hans": "\u5DF2\u5173\u95ED" }),
|
|
151
|
+
plug: on_off({ en: "Plugged in", es: "Enchufado", de: "Eingesteckt", "zh-Hant": "\u5DF2\u63D2\u96FB", "zh-Hans": "\u5DF2\u63D2\u7535" }, { en: "Unplugged", es: "Desenchufado", de: "Ausgesteckt", "zh-Hant": "\u672A\u63D2\u96FB", "zh-Hans": "\u672A\u63D2\u7535" }),
|
|
152
|
+
power: on_off({ en: "Power", es: "Con corriente", de: "Strom", "zh-Hant": "\u6709\u96FB", "zh-Hans": "\u6709\u7535" }, { en: "No power", es: "Sin corriente", de: "Kein Strom", "zh-Hant": "\u65B7\u96FB", "zh-Hans": "\u65AD\u7535" }),
|
|
153
|
+
presence: on_off({ en: "Home", es: "En casa", de: "Zuhause", "zh-Hant": "\u5728\u5BB6", "zh-Hans": "\u5728\u5BB6" }, { en: "Away", es: "Fuera", de: "Abwesend", "zh-Hant": "\u5916\u51FA", "zh-Hans": "\u5916\u51FA" }),
|
|
154
|
+
problem: on_off({ en: "Problem", es: "Problema", de: "Problem", "zh-Hant": "\u7570\u5E38", "zh-Hans": "\u5F02\u5E38" }, { en: "OK", es: "Correcto", de: "OK", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
155
|
+
running: on_off({ en: "Running", es: "En marcha", de: "L\xE4uft", "zh-Hant": "\u904B\u8F49\u4E2D", "zh-Hans": "\u8FD0\u884C\u4E2D" }, { en: "Not running", es: "Parado", de: "L\xE4uft nicht", "zh-Hant": "\u5DF2\u505C\u6B62", "zh-Hans": "\u5DF2\u505C\u6B62" }),
|
|
156
|
+
safety: on_off({ en: "Unsafe", es: "Peligro", de: "Unsicher", "zh-Hant": "\u5371\u96AA", "zh-Hans": "\u5371\u9669" }, { en: "Safe", es: "Seguro", de: "Sicher", "zh-Hant": "\u5B89\u5168", "zh-Hans": "\u5B89\u5168" }),
|
|
157
|
+
smoke: on_off({ en: "Smoke", es: "Humo", de: "Rauch", "zh-Hant": "\u6709\u7159\u9727", "zh-Hans": "\u6709\u70DF\u96FE" }, { en: "Clear", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
158
|
+
sound: on_off({ en: "Sound", es: "Sonido", de: "Ger\xE4usch", "zh-Hant": "\u6709\u8072\u97F3", "zh-Hans": "\u6709\u58F0\u97F3" }, { en: "Quiet", es: "Silencio", de: "Ruhig", "zh-Hant": "\u5B89\u975C", "zh-Hans": "\u5B89\u9759" }),
|
|
159
|
+
tamper: on_off({ en: "Tampered", es: "Manipulado", de: "Manipuliert", "zh-Hant": "\u906D\u7AC4\u6539", "zh-Hans": "\u88AB\u7BE1\u6539" }, { en: "Clear", es: "Normal", de: "Normal", "zh-Hant": "\u6B63\u5E38", "zh-Hans": "\u6B63\u5E38" }),
|
|
160
|
+
update: on_off({ en: "Update available", es: "Actualizaci\xF3n disponible", de: "Update verf\xFCgbar", "zh-Hant": "\u6709\u53EF\u7528\u66F4\u65B0", "zh-Hans": "\u6709\u53EF\u7528\u66F4\u65B0" }, { en: "Up to date", es: "Al d\xEDa", de: "Aktuell", "zh-Hant": "\u5DF2\u662F\u6700\u65B0", "zh-Hans": "\u5DF2\u662F\u6700\u65B0" }),
|
|
161
|
+
vibration: on_off({ en: "Vibration", es: "Vibraci\xF3n", de: "Vibration", "zh-Hant": "\u9707\u52D5", "zh-Hans": "\u632F\u52A8" }, { en: "Still", es: "Quieto", de: "Still", "zh-Hant": "\u975C\u6B62", "zh-Hans": "\u9759\u6B62" }),
|
|
162
|
+
window: on_off({ en: "Open", es: "Abierta", de: "Offen", "zh-Hant": "\u5DF2\u958B\u555F", "zh-Hans": "\u5DF2\u6253\u5F00" }, { en: "Closed", es: "Cerrada", de: "Geschlossen", "zh-Hant": "\u5DF2\u95DC\u9589", "zh-Hans": "\u5DF2\u5173\u95ED" })
|
|
163
163
|
};
|
|
164
164
|
var WORDS = {
|
|
165
|
-
on: { en: "On", es: "Encendido" },
|
|
166
|
-
off: { en: "Off", es: "Apagado" },
|
|
167
|
-
open: { en: "Open", es: "Abierto" },
|
|
168
|
-
opening: { en: "Opening", es: "Abriendo" },
|
|
169
|
-
closed: { en: "Closed", es: "Cerrado" },
|
|
170
|
-
closing: { en: "Closing", es: "Cerrando" },
|
|
171
|
-
locked: { en: "Locked", es: "Cerrada" },
|
|
172
|
-
unlocked: { en: "Unlocked", es: "Abierta" },
|
|
173
|
-
locking: { en: "Locking", es: "Cerrando" },
|
|
174
|
-
unlocking: { en: "Unlocking", es: "Abriendo" },
|
|
175
|
-
jammed: { en: "Jammed", es: "Atascada" },
|
|
176
|
-
home: { en: "Home", es: "En casa" },
|
|
177
|
-
not_home: { en: "Away", es: "Fuera" },
|
|
178
|
-
playing: { en: "Playing", es: "Reproduciendo" },
|
|
179
|
-
paused: { en: "Paused", es: "En pausa" },
|
|
180
|
-
idle: { en: "Idle", es: "Inactivo" },
|
|
181
|
-
standby: { en: "Standby", es: "En espera" },
|
|
182
|
-
buffering: { en: "Buffering", es: "Cargando" },
|
|
183
|
-
heat: { en: "Heat", es: "Calor" },
|
|
184
|
-
cool: { en: "Cool", es: "Fr\xEDo" },
|
|
185
|
-
heat_cool: { en: "Heat/cool", es: "Calor/fr\xEDo" },
|
|
186
|
-
auto: { en: "Auto", es: "Autom\xE1tico" },
|
|
187
|
-
dry: { en: "Dry", es: "Deshumidificar" },
|
|
188
|
-
fan_only: { en: "Fan only", es: "Solo ventilador" },
|
|
189
|
-
heating: { en: "heating", es: "calentando" },
|
|
190
|
-
cooling: { en: "cooling", es: "enfriando" },
|
|
191
|
-
drying: { en: "drying", es: "secando" },
|
|
192
|
-
fan: { en: "fan", es: "ventilando" },
|
|
193
|
-
preheating: { en: "preheating", es: "precalentando" },
|
|
194
|
-
disarmed: { en: "Disarmed", es: "Desarmada" },
|
|
195
|
-
armed_home: { en: "Armed home", es: "Armada en casa" },
|
|
196
|
-
armed_away: { en: "Armed away", es: "Armada" },
|
|
197
|
-
armed_night: { en: "Armed night", es: "Armada noche" },
|
|
198
|
-
armed_vacation: { en: "Armed vacation", es: "Armada vacaciones" },
|
|
199
|
-
armed_custom_bypass: { en: "Armed", es: "Armada" },
|
|
200
|
-
arming: { en: "Arming", es: "Armando" },
|
|
201
|
-
disarming: { en: "Disarming", es: "Desarmando" },
|
|
202
|
-
pending: { en: "Pending", es: "Pendiente" },
|
|
203
|
-
triggered: { en: "Triggered", es: "Disparada" },
|
|
204
|
-
cleaning: { en: "Cleaning", es: "Limpiando" },
|
|
205
|
-
docked: { en: "Docked", es: "En la base" },
|
|
206
|
-
returning: { en: "Returning", es: "Volviendo" },
|
|
207
|
-
error: { en: "Error", es: "Error" },
|
|
208
|
-
above_horizon: { en: "Up", es: "Sobre el horizonte" },
|
|
209
|
-
below_horizon: { en: "Down", es: "Bajo el horizonte" },
|
|
210
|
-
unavailable: { en: "Unavailable", es: "No disponible" },
|
|
211
|
-
unknown: { en: "Unknown", es: "Desconocido" },
|
|
212
|
-
sunny: { en: "Sunny", es: "Soleado" },
|
|
213
|
-
"clear-night": { en: "Clear", es: "Despejado" },
|
|
214
|
-
partlycloudy: { en: "Partly cloudy", es: "Parcialmente nublado" },
|
|
215
|
-
cloudy: { en: "Cloudy", es: "Nublado" },
|
|
216
|
-
rainy: { en: "Rain", es: "Lluvia" },
|
|
217
|
-
pouring: { en: "Heavy rain", es: "Lluvia fuerte" },
|
|
218
|
-
snowy: { en: "Snow", es: "Nieve" },
|
|
219
|
-
fog: { en: "Fog", es: "Niebla" },
|
|
220
|
-
windy: { en: "Windy", es: "Viento" },
|
|
221
|
-
lightning: { en: "Storm", es: "Tormenta" },
|
|
222
|
-
"lightning-rainy": { en: "Storm", es: "Tormenta" }
|
|
165
|
+
on: { en: "On", es: "Encendido", de: "An", "zh-Hant": "\u958B\u555F", "zh-Hans": "\u5F00\u542F" },
|
|
166
|
+
off: { en: "Off", es: "Apagado", de: "Aus", "zh-Hant": "\u95DC\u9589", "zh-Hans": "\u5173\u95ED" },
|
|
167
|
+
open: { en: "Open", es: "Abierto", de: "Offen", "zh-Hant": "\u5DF2\u958B\u555F", "zh-Hans": "\u5DF2\u6253\u5F00" },
|
|
168
|
+
opening: { en: "Opening", es: "Abriendo", de: "\xD6ffnet", "zh-Hant": "\u958B\u555F\u4E2D", "zh-Hans": "\u6B63\u5728\u6253\u5F00" },
|
|
169
|
+
closed: { en: "Closed", es: "Cerrado", de: "Geschlossen", "zh-Hant": "\u5DF2\u95DC\u9589", "zh-Hans": "\u5DF2\u5173\u95ED" },
|
|
170
|
+
closing: { en: "Closing", es: "Cerrando", de: "Schlie\xDFt", "zh-Hant": "\u95DC\u9589\u4E2D", "zh-Hans": "\u6B63\u5728\u5173\u95ED" },
|
|
171
|
+
locked: { en: "Locked", es: "Cerrada", de: "Verriegelt", "zh-Hant": "\u5DF2\u4E0A\u9396", "zh-Hans": "\u5DF2\u4E0A\u9501" },
|
|
172
|
+
unlocked: { en: "Unlocked", es: "Abierta", de: "Entriegelt", "zh-Hant": "\u5DF2\u89E3\u9396", "zh-Hans": "\u5DF2\u89E3\u9501" },
|
|
173
|
+
locking: { en: "Locking", es: "Cerrando", de: "Wird verriegelt", "zh-Hant": "\u4E0A\u9396\u4E2D", "zh-Hans": "\u6B63\u5728\u4E0A\u9501" },
|
|
174
|
+
unlocking: { en: "Unlocking", es: "Abriendo", de: "Wird entriegelt", "zh-Hant": "\u89E3\u9396\u4E2D", "zh-Hans": "\u6B63\u5728\u89E3\u9501" },
|
|
175
|
+
jammed: { en: "Jammed", es: "Atascada", de: "Blockiert", "zh-Hant": "\u5361\u4F4F", "zh-Hans": "\u5361\u4F4F" },
|
|
176
|
+
home: { en: "Home", es: "En casa", de: "Zuhause", "zh-Hant": "\u5728\u5BB6", "zh-Hans": "\u5728\u5BB6" },
|
|
177
|
+
not_home: { en: "Away", es: "Fuera", de: "Abwesend", "zh-Hant": "\u5916\u51FA", "zh-Hans": "\u5916\u51FA" },
|
|
178
|
+
playing: { en: "Playing", es: "Reproduciendo", de: "Spielt", "zh-Hant": "\u64AD\u653E\u4E2D", "zh-Hans": "\u64AD\u653E\u4E2D" },
|
|
179
|
+
paused: { en: "Paused", es: "En pausa", de: "Pausiert", "zh-Hant": "\u5DF2\u66AB\u505C", "zh-Hans": "\u5DF2\u6682\u505C" },
|
|
180
|
+
idle: { en: "Idle", es: "Inactivo", de: "Unt\xE4tig", "zh-Hant": "\u9592\u7F6E", "zh-Hans": "\u7A7A\u95F2" },
|
|
181
|
+
standby: { en: "Standby", es: "En espera", de: "Standby", "zh-Hant": "\u5F85\u6A5F", "zh-Hans": "\u5F85\u673A" },
|
|
182
|
+
buffering: { en: "Buffering", es: "Cargando", de: "Puffert", "zh-Hant": "\u7DE9\u885D\u4E2D", "zh-Hans": "\u7F13\u51B2\u4E2D" },
|
|
183
|
+
heat: { en: "Heat", es: "Calor", de: "Heizen", "zh-Hant": "\u6696\u6C23", "zh-Hans": "\u5236\u70ED" },
|
|
184
|
+
cool: { en: "Cool", es: "Fr\xEDo", de: "K\xFChlen", "zh-Hant": "\u51B7\u6C23", "zh-Hans": "\u5236\u51B7" },
|
|
185
|
+
heat_cool: { en: "Heat/cool", es: "Calor/fr\xEDo", de: "Heizen/K\xFChlen", "zh-Hant": "\u51B7\u6696", "zh-Hans": "\u51B7\u6696" },
|
|
186
|
+
auto: { en: "Auto", es: "Autom\xE1tico", de: "Automatisch", "zh-Hant": "\u81EA\u52D5", "zh-Hans": "\u81EA\u52A8" },
|
|
187
|
+
dry: { en: "Dry", es: "Deshumidificar", de: "Entfeuchten", "zh-Hant": "\u9664\u6FD5", "zh-Hans": "\u9664\u6E7F" },
|
|
188
|
+
fan_only: { en: "Fan only", es: "Solo ventilador", de: "Nur L\xFCfter", "zh-Hant": "\u50C5\u9001\u98A8", "zh-Hans": "\u4EC5\u9001\u98CE" },
|
|
189
|
+
heating: { en: "heating", es: "calentando", de: "heizt", "zh-Hant": "\u52A0\u71B1\u4E2D", "zh-Hans": "\u5236\u70ED\u4E2D" },
|
|
190
|
+
cooling: { en: "cooling", es: "enfriando", de: "k\xFChlt", "zh-Hant": "\u51B7\u537B\u4E2D", "zh-Hans": "\u5236\u51B7\u4E2D" },
|
|
191
|
+
drying: { en: "drying", es: "secando", de: "entfeuchtet", "zh-Hant": "\u9664\u6FD5\u4E2D", "zh-Hans": "\u9664\u6E7F\u4E2D" },
|
|
192
|
+
fan: { en: "fan", es: "ventilando", de: "l\xFCftet", "zh-Hant": "\u9001\u98A8\u4E2D", "zh-Hans": "\u9001\u98CE\u4E2D" },
|
|
193
|
+
preheating: { en: "preheating", es: "precalentando", de: "heizt vor", "zh-Hant": "\u9810\u71B1\u4E2D", "zh-Hans": "\u9884\u70ED\u4E2D" },
|
|
194
|
+
disarmed: { en: "Disarmed", es: "Desarmada", de: "Unscharf", "zh-Hant": "\u5DF2\u89E3\u9664\u8B66\u6212", "zh-Hans": "\u5DF2\u64A4\u9632" },
|
|
195
|
+
armed_home: { en: "Armed home", es: "Armada en casa", de: "Scharf (zu Hause)", "zh-Hant": "\u5728\u5BB6\u8B66\u6212", "zh-Hans": "\u5728\u5BB6\u5E03\u9632" },
|
|
196
|
+
armed_away: { en: "Armed away", es: "Armada", de: "Scharf (abwesend)", "zh-Hant": "\u5916\u51FA\u8B66\u6212", "zh-Hans": "\u79BB\u5BB6\u5E03\u9632" },
|
|
197
|
+
armed_night: { en: "Armed night", es: "Armada noche", de: "Scharf (Nacht)", "zh-Hant": "\u591C\u9593\u8B66\u6212", "zh-Hans": "\u591C\u95F4\u5E03\u9632" },
|
|
198
|
+
armed_vacation: { en: "Armed vacation", es: "Armada vacaciones", de: "Scharf (Urlaub)", "zh-Hant": "\u5EA6\u5047\u8B66\u6212", "zh-Hans": "\u5EA6\u5047\u5E03\u9632" },
|
|
199
|
+
armed_custom_bypass: { en: "Armed", es: "Armada", de: "Scharf", "zh-Hant": "\u5DF2\u8B66\u6212", "zh-Hans": "\u5DF2\u5E03\u9632" },
|
|
200
|
+
arming: { en: "Arming", es: "Armando", de: "Scharfschalten\u2026", "zh-Hant": "\u8B66\u6212\u555F\u52D5\u4E2D", "zh-Hans": "\u6B63\u5728\u5E03\u9632" },
|
|
201
|
+
disarming: { en: "Disarming", es: "Desarmando", de: "Unscharfschalten\u2026", "zh-Hant": "\u89E3\u9664\u8B66\u6212\u4E2D", "zh-Hans": "\u6B63\u5728\u64A4\u9632" },
|
|
202
|
+
pending: { en: "Pending", es: "Pendiente", de: "Ausstehend", "zh-Hant": "\u7B49\u5F85\u4E2D", "zh-Hans": "\u7B49\u5F85\u4E2D" },
|
|
203
|
+
triggered: { en: "Triggered", es: "Disparada", de: "Ausgel\xF6st", "zh-Hant": "\u5DF2\u89F8\u767C", "zh-Hans": "\u5DF2\u89E6\u53D1" },
|
|
204
|
+
cleaning: { en: "Cleaning", es: "Limpiando", de: "Reinigt", "zh-Hant": "\u6E05\u6383\u4E2D", "zh-Hans": "\u6E05\u626B\u4E2D" },
|
|
205
|
+
docked: { en: "Docked", es: "En la base", de: "Angedockt", "zh-Hant": "\u5728\u5145\u96FB\u5EA7", "zh-Hans": "\u5728\u5145\u7535\u5EA7" },
|
|
206
|
+
returning: { en: "Returning", es: "Volviendo", de: "Kehrt zur\xFCck", "zh-Hant": "\u8FD4\u56DE\u4E2D", "zh-Hans": "\u8FD4\u56DE\u4E2D" },
|
|
207
|
+
error: { en: "Error", es: "Error", de: "Fehler", "zh-Hant": "\u932F\u8AA4", "zh-Hans": "\u9519\u8BEF" },
|
|
208
|
+
above_horizon: { en: "Up", es: "Sobre el horizonte", de: "\xDCber dem Horizont", "zh-Hant": "\u5730\u5E73\u7DDA\u4E0A", "zh-Hans": "\u5730\u5E73\u7EBF\u4E0A" },
|
|
209
|
+
below_horizon: { en: "Down", es: "Bajo el horizonte", de: "Unter dem Horizont", "zh-Hant": "\u5730\u5E73\u7DDA\u4E0B", "zh-Hans": "\u5730\u5E73\u7EBF\u4E0B" },
|
|
210
|
+
unavailable: { en: "Unavailable", es: "No disponible", de: "Nicht verf\xFCgbar", "zh-Hant": "\u7121\u6CD5\u4F7F\u7528", "zh-Hans": "\u4E0D\u53EF\u7528" },
|
|
211
|
+
unknown: { en: "Unknown", es: "Desconocido", de: "Unbekannt", "zh-Hant": "\u672A\u77E5", "zh-Hans": "\u672A\u77E5" },
|
|
212
|
+
sunny: { en: "Sunny", es: "Soleado", de: "Sonnig", "zh-Hant": "\u6674", "zh-Hans": "\u6674" },
|
|
213
|
+
"clear-night": { en: "Clear", es: "Despejado", de: "Klar", "zh-Hant": "\u6674\u6717", "zh-Hans": "\u6674\u6717" },
|
|
214
|
+
partlycloudy: { en: "Partly cloudy", es: "Parcialmente nublado", de: "Teilweise bew\xF6lkt", "zh-Hant": "\u6674\u6642\u591A\u96F2", "zh-Hans": "\u591A\u4E91" },
|
|
215
|
+
cloudy: { en: "Cloudy", es: "Nublado", de: "Bew\xF6lkt", "zh-Hant": "\u9670", "zh-Hans": "\u9634" },
|
|
216
|
+
rainy: { en: "Rain", es: "Lluvia", de: "Regen", "zh-Hant": "\u96E8", "zh-Hans": "\u96E8" },
|
|
217
|
+
pouring: { en: "Heavy rain", es: "Lluvia fuerte", de: "Starkregen", "zh-Hant": "\u5927\u96E8", "zh-Hans": "\u5927\u96E8" },
|
|
218
|
+
snowy: { en: "Snow", es: "Nieve", de: "Schnee", "zh-Hant": "\u96EA", "zh-Hans": "\u96EA" },
|
|
219
|
+
fog: { en: "Fog", es: "Niebla", de: "Nebel", "zh-Hant": "\u9727", "zh-Hans": "\u96FE" },
|
|
220
|
+
windy: { en: "Windy", es: "Viento", de: "Windig", "zh-Hant": "\u6709\u98A8", "zh-Hans": "\u6709\u98CE" },
|
|
221
|
+
lightning: { en: "Storm", es: "Tormenta", de: "Gewitter", "zh-Hant": "\u96F7\u96E8", "zh-Hans": "\u96F7\u96E8" },
|
|
222
|
+
"lightning-rainy": { en: "Storm", es: "Tormenta", de: "Gewitter", "zh-Hant": "\u96F7\u96E8", "zh-Hans": "\u96F7\u96E8" }
|
|
223
223
|
};
|
|
224
224
|
var DOOR_LIKE = /* @__PURE__ */ new Set(["door", "garage_door", "window", "opening"]);
|
|
225
225
|
var COVER_DOOR_LIKE = /* @__PURE__ */ new Set(["door", "garage", "gate", "window"]);
|
|
@@ -322,10 +322,10 @@ function noticeOf(e, o, now) {
|
|
|
322
322
|
if (e.domain === "sensor" && e.deviceClass === "battery") {
|
|
323
323
|
if (!o.includeBatteries || level !== "warn" && level !== "alert") return null;
|
|
324
324
|
const pct = `${Math.round(numericState(e))} %`;
|
|
325
|
-
return { entity: e, level, what: { en: `Battery ${pct}`, es: `Bater\xEDa ${pct}` }, kind: "battery" };
|
|
325
|
+
return { entity: e, level, what: { en: `Battery ${pct}`, es: `Bater\xEDa ${pct}`, de: `Batterie ${pct}`, "zh-Hant": `\u96FB\u6C60 ${pct}`, "zh-Hans": `\u7535\u6C60 ${pct}` }, kind: "battery" };
|
|
326
326
|
}
|
|
327
327
|
if (e.domain === "binary_sensor" && e.deviceClass === "battery") {
|
|
328
|
-
return o.includeBatteries && e.state === "on" ? { entity: e, level: "warn", what: { en: "Battery low", es: "Bater\xEDa baja" }, kind: "battery" } : null;
|
|
328
|
+
return o.includeBatteries && e.state === "on" ? { entity: e, level: "warn", what: { en: "Battery low", es: "Bater\xEDa baja", de: "Batterie schwach", "zh-Hant": "\u96FB\u91CF\u4F4E", "zh-Hans": "\u7535\u91CF\u4F4E" }, kind: "battery" } : null;
|
|
329
329
|
}
|
|
330
330
|
if (e.domain === "update") return o.includeUpdates && e.state === "on" ? { entity: e, level: "on", what: BINARY.update.on, kind: "update" } : null;
|
|
331
331
|
if (level !== "warn") return null;
|
|
@@ -348,11 +348,44 @@ function notices(entities2, o, now) {
|
|
|
348
348
|
}
|
|
349
349
|
var HISTORY_SPAN_MS = 24 * 36e5;
|
|
350
350
|
var HISTORY_BUCKET_MS = 5 * 6e4;
|
|
351
|
+
var historyHas = (h, id) => !!h && Object.hasOwn(h.series, id);
|
|
352
|
+
function historyValues(h, id, now, spanMs, bars) {
|
|
353
|
+
const s = (Object.hasOwn(h.series, id) ? h.series[id] : void 0) ?? [];
|
|
354
|
+
const span = Math.min(spanMs, h.spanMs);
|
|
355
|
+
const out = [];
|
|
356
|
+
if (bars < 1) return out;
|
|
357
|
+
const end = Math.floor(now / h.bucketMs);
|
|
358
|
+
const start = end - Math.max(1, Math.round(span / h.bucketMs)) + 1;
|
|
359
|
+
const n = end - start + 1;
|
|
360
|
+
const per = new Array(n).fill(Number.NaN);
|
|
361
|
+
let i = 0;
|
|
362
|
+
let held = Number.NaN;
|
|
363
|
+
for (let b = start; b <= end; b++) {
|
|
364
|
+
let own;
|
|
365
|
+
while (i < s.length && s[i][0] <= b) {
|
|
366
|
+
if (s[i][0] === b) own = s[i];
|
|
367
|
+
held = s[i][3];
|
|
368
|
+
i++;
|
|
369
|
+
}
|
|
370
|
+
per[b - start] = own && b !== end ? own[1] / own[2] : held;
|
|
371
|
+
}
|
|
372
|
+
for (let k = 0; k < bars; k++) {
|
|
373
|
+
const from = Math.floor(k * n / bars);
|
|
374
|
+
const to = Math.max(from + 1, Math.floor((k + 1) * n / bars));
|
|
375
|
+
const chunk = per.slice(from, to).filter((v) => Number.isFinite(v));
|
|
376
|
+
out.push(chunk.length ? chunk.reduce((a, v) => a + v, 0) / chunk.length : Number.NaN);
|
|
377
|
+
}
|
|
378
|
+
return out;
|
|
379
|
+
}
|
|
351
380
|
var History = class {
|
|
352
381
|
spanMs;
|
|
353
382
|
bucketMs;
|
|
354
|
-
/** Per entity, buckets in time order
|
|
383
|
+
/** Per entity, buckets in time order. */
|
|
355
384
|
series = /* @__PURE__ */ new Map();
|
|
385
|
+
/** Copies of the series as last emitted, per entity; dropped when one changes. */
|
|
386
|
+
copies = /* @__PURE__ */ new Map();
|
|
387
|
+
/** The last `data()`, while nothing has changed since. */
|
|
388
|
+
emitted;
|
|
356
389
|
constructor(spanMs = HISTORY_SPAN_MS, bucketMs = HISTORY_BUCKET_MS) {
|
|
357
390
|
this.spanMs = spanMs;
|
|
358
391
|
this.bucketMs = bucketMs;
|
|
@@ -363,12 +396,19 @@ var History = class {
|
|
|
363
396
|
get size() {
|
|
364
397
|
return this.series.size;
|
|
365
398
|
}
|
|
399
|
+
touched(id) {
|
|
400
|
+
this.copies.delete(id);
|
|
401
|
+
this.emitted = void 0;
|
|
402
|
+
}
|
|
366
403
|
/** Starts following `id` (with no samples yet). */
|
|
367
404
|
track(id) {
|
|
368
|
-
if (
|
|
405
|
+
if (this.series.has(id)) return;
|
|
406
|
+
this.series.set(id, []);
|
|
407
|
+
this.touched(id);
|
|
369
408
|
}
|
|
370
409
|
forget(id) {
|
|
371
|
-
this.series.delete(id);
|
|
410
|
+
if (!this.series.delete(id)) return;
|
|
411
|
+
this.touched(id);
|
|
372
412
|
}
|
|
373
413
|
/** Adds a sample. Older than the span, or older than the newest bucket of the series: ignored. */
|
|
374
414
|
add(id, at, value, now = at) {
|
|
@@ -387,46 +427,32 @@ var History = class {
|
|
|
387
427
|
let cut = 0;
|
|
388
428
|
while (cut + 1 < s.length && s[cut + 1][0] <= oldest) cut++;
|
|
389
429
|
if (cut) s.splice(0, cut);
|
|
430
|
+
this.touched(id);
|
|
390
431
|
}
|
|
391
432
|
/** Replaces a series with samples from the history API (oldest first). */
|
|
392
433
|
fill(id, samples, now) {
|
|
393
434
|
this.series.set(id, []);
|
|
435
|
+
this.touched(id);
|
|
394
436
|
for (const x of samples) this.add(id, x.at, x.value, now);
|
|
395
437
|
}
|
|
438
|
+
/** See `historyValues`. */
|
|
439
|
+
values(id, now, spanMs, bars) {
|
|
440
|
+
return historyValues(this.data(), id, now, spanMs, bars);
|
|
441
|
+
}
|
|
396
442
|
/**
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
* last
|
|
400
|
-
* open (the one of `now`) counts as its latest value, so the last bar is
|
|
401
|
-
* what the sensor says now. `NaN` before the first sample.
|
|
443
|
+
* A plain copy, for the source's data. The same object while nothing
|
|
444
|
+
* changed, and the series that didn't change are the same arrays as in
|
|
445
|
+
* the last one, so copying and comparing stay cheap.
|
|
402
446
|
*/
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
const n = end - start + 1;
|
|
411
|
-
const per = new Array(n).fill(Number.NaN);
|
|
412
|
-
let i = 0;
|
|
413
|
-
let held = Number.NaN;
|
|
414
|
-
for (let b = start; b <= end; b++) {
|
|
415
|
-
let own;
|
|
416
|
-
while (i < s.length && s[i][0] <= b) {
|
|
417
|
-
if (s[i][0] === b) own = s[i];
|
|
418
|
-
held = s[i][3];
|
|
419
|
-
i++;
|
|
420
|
-
}
|
|
421
|
-
per[b - start] = own && b !== end ? own[1] / own[2] : held;
|
|
422
|
-
}
|
|
423
|
-
for (let k = 0; k < bars; k++) {
|
|
424
|
-
const from = Math.floor(k * n / bars);
|
|
425
|
-
const to = Math.max(from + 1, Math.floor((k + 1) * n / bars));
|
|
426
|
-
const chunk = per.slice(from, to).filter((v) => Number.isFinite(v));
|
|
427
|
-
out.push(chunk.length ? chunk.reduce((a, v) => a + v, 0) / chunk.length : Number.NaN);
|
|
447
|
+
data() {
|
|
448
|
+
if (this.emitted) return this.emitted;
|
|
449
|
+
const series = {};
|
|
450
|
+
for (const [id, s] of this.series) {
|
|
451
|
+
let copy = this.copies.get(id);
|
|
452
|
+
if (!copy) this.copies.set(id, copy = s.map((b) => [b[0], b[1], b[2], b[3]]));
|
|
453
|
+
series[id] = copy;
|
|
428
454
|
}
|
|
429
|
-
return
|
|
455
|
+
return this.emitted = { spanMs: this.spanMs, bucketMs: this.bucketMs, series };
|
|
430
456
|
}
|
|
431
457
|
};
|
|
432
458
|
function parseHistory(rows) {
|
|
@@ -443,41 +469,40 @@ function parseHistory(rows) {
|
|
|
443
469
|
}
|
|
444
470
|
var wantsHistory = (e) => numericState(e) !== void 0 && (e.stateClass === "measurement" || e.stateClass === "total" || !!e.unit && e.domain === "sensor");
|
|
445
471
|
function demoHome(now, locale = "en") {
|
|
446
|
-
const
|
|
447
|
-
const n = (en, sp) => es ? sp : en;
|
|
472
|
+
const n = (text) => localize(text, locale);
|
|
448
473
|
const ago = (ms) => now - ms;
|
|
449
474
|
const min = 6e4;
|
|
450
475
|
const raw = [
|
|
451
|
-
{ id: "sensor.living_room_temperature", name: n("Living room temperature", "Temperatura sal\xF3n"), state: "21.4", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(4 * min) },
|
|
452
|
-
{ id: "sensor.living_room_humidity", name: n("Living room humidity", "Humedad sal\xF3n"), state: "48", unit: "%", deviceClass: "humidity", stateClass: "measurement", changedAt: ago(9 * min) },
|
|
453
|
-
{ id: "sensor.bedroom_temperature", name: n("Bedroom temperature", "Temperatura dormitorio"), state: "19.8", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(2 * min) },
|
|
454
|
-
{ id: "sensor.outdoor_temperature", name: n("Outdoor temperature", "Temperatura exterior"), state: "11.2", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(6 * min) },
|
|
455
|
-
{ id: "sensor.house_power", name: n("House power", "Consumo de la casa"), state: "1534", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.2 * min) },
|
|
456
|
-
{ id: "sensor.solar_power", name: n("Solar production", "Producci\xF3n solar"), state: "2210", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.4 * min) },
|
|
457
|
-
{ id: "sensor.grid_power", name: n("Grid power", "Potencia de la red"), state: "0", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.1 * min) },
|
|
458
|
-
{ id: "sensor.battery_power", name: n("Battery power", "Potencia de la bater\xEDa"), state: "-420", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.1 * min) },
|
|
459
|
-
{ id: "sensor.battery_level", name: n("Battery level", "Nivel de la bater\xEDa"), state: "64", unit: "%", deviceClass: "battery", stateClass: "measurement", changedAt: ago(3 * min) },
|
|
460
|
-
{ id: "sensor.energy_today", name: n("Energy today", "Energ\xEDa hoy"), state: "7.84", unit: "kWh", deviceClass: "energy", stateClass: "total_increasing", changedAt: ago(1 * min) },
|
|
461
|
-
{ id: "sensor.hallway_motion_battery", name: n("Hallway sensor battery", "Bater\xEDa sensor pasillo"), state: "8", unit: "%", deviceClass: "battery", stateClass: "measurement", changedAt: ago(30 * 36e5) },
|
|
462
|
-
{ id: "sensor.front_door_lock_battery", name: n("Front door lock battery", "Bater\xEDa cerradura"), state: "64", unit: "%", deviceClass: "battery", stateClass: "measurement", changedAt: ago(3 * 36e5) },
|
|
463
|
-
{ id: "binary_sensor.balcony_door", name: n("Balcony door", "Puerta del balc\xF3n"), state: "on", deviceClass: "door", changedAt: ago(42 * min) },
|
|
464
|
-
{ id: "binary_sensor.front_door", name: n("Front door", "Puerta de entrada"), state: "off", deviceClass: "door", changedAt: ago(95 * min) },
|
|
465
|
-
{ id: "binary_sensor.kitchen_window", name: n("Kitchen window", "Ventana cocina"), state: "off", deviceClass: "window", changedAt: ago(5 * 36e5) },
|
|
466
|
-
{ id: "camera.porch", name: n("Porch", "Porche"), state: "idle", picture: "/api/camera_proxy/camera.porch?token=demo", changedAt: ago(3 * 36e5) },
|
|
467
|
-
{ id: "binary_sensor.porch_motion", name: n("Porch motion", "Movimiento porche"), state: "off", deviceClass: "motion", changedAt: ago(12 * min) },
|
|
468
|
-
{ id: "binary_sensor.hallway_motion", name: n("Hallway motion", "Movimiento pasillo"), state: "on", deviceClass: "motion", changedAt: ago(1 * min) },
|
|
469
|
-
{ id: "binary_sensor.washing_machine_leak", name: n("Washing machine leak", "Fuga lavadora"), state: "off", deviceClass: "moisture", changedAt: ago(26 * 36e5) },
|
|
470
|
-
{ id: "lock.front_door", name: n("Front door lock", "Cerradura entrada"), state: "locked", changedAt: ago(95 * min) },
|
|
471
|
-
{ id: "light.living_room", name: n("Living room lights", "Luces sal\xF3n"), state: "on", changedAt: ago(37 * min) },
|
|
472
|
-
{ id: "light.kitchen", name: n("Kitchen lights", "Luces cocina"), state: "off", changedAt: ago(70 * min) },
|
|
473
|
-
{ id: "switch.coffee_machine", name: n("Coffee machine", "Cafetera"), state: "off", changedAt: ago(2 * 36e5) },
|
|
474
|
-
{ id: "climate.living_room", name: n("Thermostat", "Termostato"), state: "heat", current: 21.4, target: 22, action: "heating", unit: "\xB0C", changedAt: ago(3 * 36e5) },
|
|
475
|
-
{ id: "person.alex", name: "Alex", state: "home", changedAt: ago(4 * 36e5) },
|
|
476
|
-
{ id: "person.sam", name: "Sam", state: n("Work", "Trabajo"), changedAt: ago(6 * 36e5) },
|
|
477
|
-
{ id: "person.robin", name: "Robin", state: "not_home", changedAt: ago(35 * min) },
|
|
478
|
-
{ id: "media_player.living_room_speaker", name: n("Living room speaker", "Altavoz del sal\xF3n"), state: "playing", picture: "/api/media_player_proxy/media_player.living_room_speaker?token=demo", media: { title: n("Blue in Green", "Blue in Green"), artist: "Miles Davis", album: "Kind of Blue", app: "Spotify", duration: 337, position: 128, positionAt: ago(0) }, changedAt: ago(3 * min) },
|
|
479
|
-
{ id: "media_player.living_room_tv", name: n("Living room TV", "Tele del sal\xF3n"), state: "playing", changedAt: ago(25 * min) },
|
|
480
|
-
{ id: "sensor.garage_temperature", name: n("Garage temperature", "Temperatura garaje"), state: "unavailable", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(14 * 36e5) },
|
|
476
|
+
{ id: "sensor.living_room_temperature", name: n({ en: "Living room temperature", de: "Temperatur Wohnzimmer", es: "Temperatura sal\xF3n", "zh-Hant": "\u5BA2\u5EF3\u6EAB\u5EA6", "zh-Hans": "\u5BA2\u5385\u6E29\u5EA6" }), state: "21.4", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(4 * min) },
|
|
477
|
+
{ id: "sensor.living_room_humidity", name: n({ en: "Living room humidity", de: "Luftfeuchte Wohnzimmer", es: "Humedad sal\xF3n", "zh-Hant": "\u5BA2\u5EF3\u6FD5\u5EA6", "zh-Hans": "\u5BA2\u5385\u6E7F\u5EA6" }), state: "48", unit: "%", deviceClass: "humidity", stateClass: "measurement", changedAt: ago(9 * min) },
|
|
478
|
+
{ id: "sensor.bedroom_temperature", name: n({ en: "Bedroom temperature", de: "Temperatur Schlafzimmer", es: "Temperatura dormitorio", "zh-Hant": "\u81E5\u5BA4\u6EAB\u5EA6", "zh-Hans": "\u5367\u5BA4\u6E29\u5EA6" }), state: "19.8", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(2 * min) },
|
|
479
|
+
{ id: "sensor.outdoor_temperature", name: n({ en: "Outdoor temperature", de: "Au\xDFentemperatur", es: "Temperatura exterior", "zh-Hant": "\u5BA4\u5916\u6EAB\u5EA6", "zh-Hans": "\u5BA4\u5916\u6E29\u5EA6" }), state: "11.2", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(6 * min) },
|
|
480
|
+
{ id: "sensor.house_power", name: n({ en: "House power", de: "Verbrauch Haus", es: "Consumo de la casa", "zh-Hant": "\u5168\u5C4B\u7528\u96FB", "zh-Hans": "\u5168\u5C4B\u7528\u7535" }), state: "1534", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.2 * min) },
|
|
481
|
+
{ id: "sensor.solar_power", name: n({ en: "Solar production", de: "Solarertrag", es: "Producci\xF3n solar", "zh-Hant": "\u592A\u967D\u80FD\u767C\u96FB", "zh-Hans": "\u5149\u4F0F\u53D1\u7535" }), state: "2210", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.4 * min) },
|
|
482
|
+
{ id: "sensor.grid_power", name: n({ en: "Grid power", de: "Netzleistung", es: "Potencia de la red", "zh-Hant": "\u5E02\u96FB\u529F\u7387", "zh-Hans": "\u7535\u7F51\u529F\u7387" }), state: "0", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.1 * min) },
|
|
483
|
+
{ id: "sensor.battery_power", name: n({ en: "Battery power", de: "Batterieleistung", es: "Potencia de la bater\xEDa", "zh-Hant": "\u96FB\u6C60\u529F\u7387", "zh-Hans": "\u7535\u6C60\u529F\u7387" }), state: "-420", unit: "W", deviceClass: "power", stateClass: "measurement", changedAt: ago(0.1 * min) },
|
|
484
|
+
{ id: "sensor.battery_level", name: n({ en: "Battery level", de: "Batteriestand", es: "Nivel de la bater\xEDa", "zh-Hant": "\u96FB\u6C60\u96FB\u91CF", "zh-Hans": "\u7535\u6C60\u7535\u91CF" }), state: "64", unit: "%", deviceClass: "battery", stateClass: "measurement", changedAt: ago(3 * min) },
|
|
485
|
+
{ id: "sensor.energy_today", name: n({ en: "Energy today", de: "Energie heute", es: "Energ\xEDa hoy", "zh-Hant": "\u4ECA\u65E5\u7528\u96FB", "zh-Hans": "\u4ECA\u65E5\u7528\u7535" }), state: "7.84", unit: "kWh", deviceClass: "energy", stateClass: "total_increasing", changedAt: ago(1 * min) },
|
|
486
|
+
{ id: "sensor.hallway_motion_battery", name: n({ en: "Hallway sensor battery", de: "Batterie Sensor Flur", es: "Bater\xEDa sensor pasillo", "zh-Hant": "\u8D70\u5ECA\u611F\u6E2C\u5668\u96FB\u6C60", "zh-Hans": "\u8D70\u5ECA\u4F20\u611F\u5668\u7535\u6C60" }), state: "8", unit: "%", deviceClass: "battery", stateClass: "measurement", changedAt: ago(30 * 36e5) },
|
|
487
|
+
{ id: "sensor.front_door_lock_battery", name: n({ en: "Front door lock battery", de: "Batterie T\xFCrschloss", es: "Bater\xEDa cerradura", "zh-Hant": "\u5927\u9580\u9580\u9396\u96FB\u6C60", "zh-Hans": "\u5927\u95E8\u95E8\u9501\u7535\u6C60" }), state: "64", unit: "%", deviceClass: "battery", stateClass: "measurement", changedAt: ago(3 * 36e5) },
|
|
488
|
+
{ id: "binary_sensor.balcony_door", name: n({ en: "Balcony door", de: "Balkont\xFCr", es: "Puerta del balc\xF3n", "zh-Hant": "\u967D\u53F0\u9580", "zh-Hans": "\u9633\u53F0\u95E8" }), state: "on", deviceClass: "door", changedAt: ago(42 * min) },
|
|
489
|
+
{ id: "binary_sensor.front_door", name: n({ en: "Front door", de: "Haust\xFCr", es: "Puerta de entrada", "zh-Hant": "\u5927\u9580", "zh-Hans": "\u5927\u95E8" }), state: "off", deviceClass: "door", changedAt: ago(95 * min) },
|
|
490
|
+
{ id: "binary_sensor.kitchen_window", name: n({ en: "Kitchen window", de: "K\xFCchenfenster", es: "Ventana cocina", "zh-Hant": "\u5EDA\u623F\u7A97\u6236", "zh-Hans": "\u53A8\u623F\u7A97\u6237" }), state: "off", deviceClass: "window", changedAt: ago(5 * 36e5) },
|
|
491
|
+
{ id: "camera.porch", name: n({ en: "Porch", de: "Eingang", es: "Porche", "zh-Hant": "\u9580\u5ECA", "zh-Hans": "\u95E8\u5ECA" }), state: "idle", picture: "/api/camera_proxy/camera.porch?token=demo", changedAt: ago(3 * 36e5) },
|
|
492
|
+
{ id: "binary_sensor.porch_motion", name: n({ en: "Porch motion", de: "Bewegung Eingang", es: "Movimiento porche", "zh-Hant": "\u9580\u5ECA\u52D5\u614B", "zh-Hans": "\u95E8\u5ECA\u4EBA\u4F53\u611F\u5E94" }), state: "off", deviceClass: "motion", changedAt: ago(12 * min) },
|
|
493
|
+
{ id: "binary_sensor.hallway_motion", name: n({ en: "Hallway motion", de: "Bewegung Flur", es: "Movimiento pasillo", "zh-Hant": "\u8D70\u5ECA\u52D5\u614B", "zh-Hans": "\u8D70\u5ECA\u4EBA\u4F53\u611F\u5E94" }), state: "on", deviceClass: "motion", changedAt: ago(1 * min) },
|
|
494
|
+
{ id: "binary_sensor.washing_machine_leak", name: n({ en: "Washing machine leak", de: "Leck Waschmaschine", es: "Fuga lavadora", "zh-Hant": "\u6D17\u8863\u6A5F\u6F0F\u6C34", "zh-Hans": "\u6D17\u8863\u673A\u6F0F\u6C34" }), state: "off", deviceClass: "moisture", changedAt: ago(26 * 36e5) },
|
|
495
|
+
{ id: "lock.front_door", name: n({ en: "Front door lock", de: "T\xFCrschloss Haust\xFCr", es: "Cerradura entrada", "zh-Hant": "\u5927\u9580\u9580\u9396", "zh-Hans": "\u5927\u95E8\u95E8\u9501" }), state: "locked", changedAt: ago(95 * min) },
|
|
496
|
+
{ id: "light.living_room", name: n({ en: "Living room lights", de: "Licht Wohnzimmer", es: "Luces sal\xF3n", "zh-Hant": "\u5BA2\u5EF3\u71C8", "zh-Hans": "\u5BA2\u5385\u706F" }), state: "on", changedAt: ago(37 * min) },
|
|
497
|
+
{ id: "light.kitchen", name: n({ en: "Kitchen lights", de: "Licht K\xFCche", es: "Luces cocina", "zh-Hant": "\u5EDA\u623F\u71C8", "zh-Hans": "\u53A8\u623F\u706F" }), state: "off", changedAt: ago(70 * min) },
|
|
498
|
+
{ id: "switch.coffee_machine", name: n({ en: "Coffee machine", de: "Kaffeemaschine", es: "Cafetera", "zh-Hant": "\u5496\u5561\u6A5F", "zh-Hans": "\u5496\u5561\u673A" }), state: "off", changedAt: ago(2 * 36e5) },
|
|
499
|
+
{ id: "climate.living_room", name: n({ en: "Thermostat", de: "Thermostat", es: "Termostato", "zh-Hant": "\u6EAB\u63A7\u5668", "zh-Hans": "\u6E29\u63A7\u5668" }), state: "heat", current: 21.4, target: 22, action: "heating", unit: "\xB0C", changedAt: ago(3 * 36e5) },
|
|
500
|
+
{ id: "person.alex", name: n({ en: "Alex", de: "Alex", es: "Alex", "zh-Hant": "\u5FD7\u660E", "zh-Hans": "\u5B50\u8F69" }), state: "home", changedAt: ago(4 * 36e5) },
|
|
501
|
+
{ id: "person.sam", name: n({ en: "Sam", de: "Sam", es: "Sam", "zh-Hant": "\u6021\u541B", "zh-Hans": "\u6B23\u6021" }), state: n({ en: "Work", de: "Arbeit", es: "Trabajo", "zh-Hant": "\u4E0A\u73ED", "zh-Hans": "\u4E0A\u73ED" }), changedAt: ago(6 * 36e5) },
|
|
502
|
+
{ id: "person.robin", name: n({ en: "Robin", de: "Robin", es: "Robin", "zh-Hant": "\u51A0\u5B87", "zh-Hans": "\u6D69\u7136" }), state: "not_home", changedAt: ago(35 * min) },
|
|
503
|
+
{ id: "media_player.living_room_speaker", name: n({ en: "Living room speaker", de: "Lautsprecher Wohnzimmer", es: "Altavoz del sal\xF3n", "zh-Hant": "\u5BA2\u5EF3\u5587\u53ED", "zh-Hans": "\u5BA2\u5385\u97F3\u7BB1" }), state: "playing", picture: "/api/media_player_proxy/media_player.living_room_speaker?token=demo", media: { title: n({ en: "Blue in Green", de: "Blue in Green", es: "Blue in Green", "zh-Hant": "Blue in Green", "zh-Hans": "Blue in Green" }), artist: "Miles Davis", album: "Kind of Blue", app: "Spotify", duration: 337, position: 128, positionAt: ago(0) }, changedAt: ago(3 * min) },
|
|
504
|
+
{ id: "media_player.living_room_tv", name: n({ en: "Living room TV", de: "Fernseher Wohnzimmer", es: "Tele del sal\xF3n", "zh-Hant": "\u5BA2\u5EF3\u96FB\u8996", "zh-Hans": "\u5BA2\u5385\u7535\u89C6" }), state: "playing", changedAt: ago(25 * min) },
|
|
505
|
+
{ id: "sensor.garage_temperature", name: n({ en: "Garage temperature", de: "Temperatur Garage", es: "Temperatura garaje", "zh-Hant": "\u8ECA\u5EAB\u6EAB\u5EA6", "zh-Hans": "\u8F66\u5E93\u6E29\u5EA6" }), state: "unavailable", unit: "\xB0C", deviceClass: "temperature", stateClass: "measurement", changedAt: ago(14 * 36e5) },
|
|
481
506
|
{ id: "update.home_assistant_core_update", name: "Home Assistant Core", state: "on", changedAt: ago(20 * 36e5) }
|
|
482
507
|
];
|
|
483
508
|
const entities2 = {};
|
|
@@ -503,7 +528,7 @@ function demoHome(now, locale = "en") {
|
|
|
503
528
|
const w = (id) => Number(entities2[id].state);
|
|
504
529
|
entities2["sensor.grid_power"].state = String(Math.round(w("sensor.house_power") - w("sensor.solar_power") - w("sensor.battery_power")));
|
|
505
530
|
const energy2 = { gridIn: 3.1, gridOut: 4.6, solar: 14.2, batteryIn: 3.4, batteryOut: 2.1, at: now };
|
|
506
|
-
return { state: "ok", version: "2026.11.1", base: "http://homeassistant.local:8123", energy: energy2, entities: entities2, history };
|
|
531
|
+
return { state: "ok", version: "2026.11.1", base: "http://homeassistant.local:8123", energy: energy2, entities: entities2, history: history.data() };
|
|
507
532
|
}
|
|
508
533
|
|
|
509
534
|
// src/connection.ts
|
|
@@ -562,7 +587,7 @@ function connect(o, emit, deps = {}) {
|
|
|
562
587
|
base: httpBase(o.url),
|
|
563
588
|
...energy2 ? { energy: energy2 } : {},
|
|
564
589
|
entities: Object.fromEntries(entities2),
|
|
565
|
-
history
|
|
590
|
+
history: history.data()
|
|
566
591
|
});
|
|
567
592
|
const flush = () => {
|
|
568
593
|
flushTimer = null;
|
|
@@ -1218,6 +1243,18 @@ function drawMessage(g, box, { theme, kit }, text, hint) {
|
|
|
1218
1243
|
for (const [i, line] of lines.entries()) kit.drawTracked(g, line, box.x, box.y + s * 1.1 + hs * 1.6 + i * hs * 1.35, ho);
|
|
1219
1244
|
}
|
|
1220
1245
|
}
|
|
1246
|
+
function errorHint(error, tr) {
|
|
1247
|
+
if (error?.startsWith("token refused")) {
|
|
1248
|
+
return tr({
|
|
1249
|
+
en: "Token refused: create a long-lived access token in Home Assistant and set it in Settings \u2192 Data sources",
|
|
1250
|
+
es: "Token rechazado: crea un token de acceso de larga duraci\xF3n en Home Assistant y ponlo en Ajustes \u2192 Fuentes de datos",
|
|
1251
|
+
de: "Token abgelehnt: Erstelle in Home Assistant einen langlebigen Zugriffstoken und trage ihn unter Einstellungen \u2192 Datenquellen ein",
|
|
1252
|
+
"zh-Hant": "\u6B0A\u6756\u906D\u62D2\uFF1A\u8ACB\u5728 Home Assistant \u4E2D\u5EFA\u7ACB\u9577\u671F\u5B58\u53D6\u6B0A\u6756\uFF0C\u4E26\u586B\u5165\u300C\u8A2D\u5B9A \u2192 \u8CC7\u6599\u4F86\u6E90\u300D",
|
|
1253
|
+
"zh-Hans": "\u4EE4\u724C\u88AB\u62D2\u7EDD\uFF1A\u8BF7\u5728 Home Assistant \u4E2D\u521B\u5EFA\u957F\u671F\u8BBF\u95EE\u4EE4\u724C\uFF0C\u5E76\u586B\u5199\u5230\u201C\u8BBE\u7F6E \u2192 \u6570\u636E\u6E90\u201D"
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
return error;
|
|
1257
|
+
}
|
|
1221
1258
|
function drawTrend(g, x, y, size, up, color) {
|
|
1222
1259
|
const w = size * 0.62, h = size * 0.5, top = y - size * 0.62;
|
|
1223
1260
|
g.fillStyle = color;
|
|
@@ -1481,18 +1518,18 @@ function renderNumber(g, ctx, e, data, box) {
|
|
|
1481
1518
|
const num2 = formatNumber(n, locale, dec);
|
|
1482
1519
|
const unit = e.unit ?? "";
|
|
1483
1520
|
const fmtLike = (v) => `${formatNumber(v, locale, dec, n)}${isTemperature(unit) ? "\xB0" : ""}`;
|
|
1484
|
-
const history = options.showHistory && data.history
|
|
1521
|
+
const history = options.showHistory && historyHas(data.history, e.id) ? data.history : void 0;
|
|
1485
1522
|
const points = Math.max(12, Math.min(Math.round(options.historyMs / 3e5), Math.floor(box.w / 5)));
|
|
1486
|
-
const values = history ? history
|
|
1523
|
+
const values = history ? historyValues(history, e.id, now, options.historyMs, points) : [];
|
|
1487
1524
|
const scale = curveScale(values, minSpan(e, n));
|
|
1488
1525
|
const hasChart = !!scale && box.h >= 84 && box.w >= 120;
|
|
1489
1526
|
const wide = hasChart && box.w >= box.h * 2.2;
|
|
1490
1527
|
let trend = null;
|
|
1491
1528
|
if (history) {
|
|
1492
|
-
const hour = history
|
|
1529
|
+
const hour = historyValues(history, e.id, now, 36e5, 12).filter((v) => Number.isFinite(v));
|
|
1493
1530
|
const delta = hour.length >= 2 ? n - hour[0] : 0;
|
|
1494
1531
|
const shown = formatNumber(Math.abs(delta), locale, dec, n);
|
|
1495
|
-
if (Number(shown.replace(",", ".").replace(/[^\d.]/g, "")) > 0) trend = { up: delta > 0, text: `${shown}${isTemperature(unit) ? "\xB0" : unit ? ` ${unit}` : ""} \xB7 ${
|
|
1532
|
+
if (Number(shown.replace(",", ".").replace(/[^\d.]/g, "")) > 0) trend = { up: delta > 0, text: `${shown}${isTemperature(unit) ? "\xB0" : unit ? ` ${unit}` : ""} \xB7 ${ctx.fmt.duration(36e5, { compact: true })}` };
|
|
1496
1533
|
}
|
|
1497
1534
|
const hs = headerSize(box);
|
|
1498
1535
|
const iconColor = loud ? tone : colors.inkDim;
|
|
@@ -1597,8 +1634,8 @@ function renderClimate(g, ctx, e, box) {
|
|
|
1597
1634
|
const col = { x: box.x, y: box.y, w: colW, h: box.h };
|
|
1598
1635
|
const hs = headerSize(box);
|
|
1599
1636
|
const headH = drawHeader(g, ctx, e, col, hs, off ? colors.inkDim : tone);
|
|
1600
|
-
const doing = action && action !== "idle" && action !== "off" ? tr({ heating: { en: "Heating", es: "Calentando" }, cooling: { en: "Cooling", es: "Enfriando" }, drying: { en: "Drying", es: "Secando" }, fan: { en: "Fan", es: "Ventilando" }, preheating: { en: "Preheating", es: "Precalentando" } }[action] ?? { en: action }) : stateText({ ...e, current: void 0 }, ctx);
|
|
1601
|
-
const target = e.target !== void 0 && !off && !dial ? `${tr({ en: "to", es: "a" })} ${t1(e.target)}` : "";
|
|
1637
|
+
const doing = action && action !== "idle" && action !== "off" ? tr({ heating: { en: "Heating", es: "Calentando", de: "Heizt", "zh-Hant": "\u52A0\u71B1\u4E2D", "zh-Hans": "\u5236\u70ED\u4E2D" }, cooling: { en: "Cooling", es: "Enfriando", de: "K\xFChlt", "zh-Hant": "\u51B7\u537B\u4E2D", "zh-Hans": "\u5236\u51B7\u4E2D" }, drying: { en: "Drying", es: "Secando", de: "Entfeuchtet", "zh-Hant": "\u9664\u6FD5\u4E2D", "zh-Hans": "\u9664\u6E7F\u4E2D" }, fan: { en: "Fan", es: "Ventilando", de: "L\xFCftet", "zh-Hant": "\u9001\u98A8\u4E2D", "zh-Hans": "\u9001\u98CE\u4E2D" }, preheating: { en: "Preheating", es: "Precalentando", de: "Heizt vor", "zh-Hant": "\u9810\u71B1\u4E2D", "zh-Hans": "\u9884\u70ED\u4E2D" } }[action] ?? { en: action }) : stateText({ ...e, current: void 0 }, ctx);
|
|
1638
|
+
const target = e.target !== void 0 && !off && !dial ? `${tr({ en: "to", es: "a", de: "auf", "zh-Hant": "\u81F3", "zh-Hans": "\u81F3" })} ${t1(e.target)}` : "";
|
|
1602
1639
|
const ss = Math.max(11, Math.min(22, Math.round(box.h * 0.095)));
|
|
1603
1640
|
const subH = ss * 1.9;
|
|
1604
1641
|
const valueTop = box.y + (headH ? headH + hs * 0.5 : 0);
|
|
@@ -1667,10 +1704,13 @@ function placePicture(box, w, h, fit2, fy) {
|
|
|
1667
1704
|
var KEEP = { top: 0, center: 0.5, bottom: 1 };
|
|
1668
1705
|
var camera = defineWidget({
|
|
1669
1706
|
id: "camera",
|
|
1670
|
-
name: { en: "Camera", es: "C\xE1mara" },
|
|
1707
|
+
name: { en: "Camera", es: "C\xE1mara", de: "Kamera", "zh-Hant": "\u651D\u5F71\u6A5F", "zh-Hans": "\u6444\u50CF\u5934" },
|
|
1671
1708
|
description: {
|
|
1672
1709
|
en: "The latest picture of a Home Assistant camera (Blink, Reolink, ONVIF\u2026), refreshed every minute, with how old it is; with a motion sensor, a red mark while it sees someone, and it can take over its tile. A still, not live video.",
|
|
1673
|
-
es: "La \xFAltima imagen de una c\xE1mara de Home Assistant (Blink, Reolink, ONVIF\u2026), refrescada cada minuto, con su antig\xFCedad; con un sensor de movimiento, una marca roja mientras ve a alguien, y puede quedarse con su tesela. Una foto, no v\xEDdeo en directo."
|
|
1710
|
+
es: "La \xFAltima imagen de una c\xE1mara de Home Assistant (Blink, Reolink, ONVIF\u2026), refrescada cada minuto, con su antig\xFCedad; con un sensor de movimiento, una marca roja mientras ve a alguien, y puede quedarse con su tesela. Una foto, no v\xEDdeo en directo.",
|
|
1711
|
+
de: "Das neueste Bild einer Home-Assistant-Kamera (Blink, Reolink, ONVIF\u2026), jede Minute aktualisiert, mit seinem Alter; mit einem Bewegungssensor eine rote Markierung, solange sie jemanden sieht, und sie kann ihre Kachel \xFCbernehmen. Ein Standbild, kein Live-Video.",
|
|
1712
|
+
"zh-Hant": "\u6700\u65B0\u4E00\u5F35 Home Assistant \u651D\u5F71\u6A5F\u756B\u9762\uFF08Blink\u3001Reolink\u3001ONVIF\u2026\uFF09\uFF0C\u6BCF\u5206\u9418\u91CD\u65B0\u6574\u7406\uFF0C\u4E26\u6A19\u793A\u756B\u9762\u662F\u591A\u4E45\u524D\u7684\uFF1B\u642D\u914D\u52D5\u4F5C\u611F\u6E2C\u5668\u6642\uFF0C\u5075\u6E2C\u5230\u6709\u4EBA\u6703\u986F\u793A\u7D05\u8272\u6A19\u8A18\uFF0C\u4E14\u53EF\u4F54\u7528\u5176\u65B9\u683C\u3002\u662F\u975C\u614B\u756B\u9762\uFF0C\u4E0D\u662F\u5373\u6642\u5F71\u50CF\u3002",
|
|
1713
|
+
"zh-Hans": "\u6700\u65B0\u4E00\u5F20 Home Assistant \u6444\u50CF\u5934\u753B\u9762\uFF08Blink\u3001Reolink\u3001ONVIF\u2026\uFF09\uFF0C\u6BCF\u5206\u949F\u5237\u65B0\uFF0C\u5E76\u6807\u51FA\u753B\u9762\u662F\u591A\u4E45\u524D\u7684\uFF1B\u914D\u5408\u8FD0\u52A8\u4F20\u611F\u5668\u65F6\uFF0C\u68C0\u6D4B\u5230\u6709\u4EBA\u4F1A\u663E\u793A\u7EA2\u8272\u6807\u8BB0\uFF0C\u5E76\u53EF\u5360\u7528\u5176\u683C\u5B50\u3002\u662F\u9759\u6001\u753B\u9762\uFF0C\u4E0D\u662F\u5B9E\u65F6\u89C6\u9891\u3002"
|
|
1674
1714
|
},
|
|
1675
1715
|
icon: "cctv",
|
|
1676
1716
|
category: "media",
|
|
@@ -1682,32 +1722,32 @@ var camera = defineWidget({
|
|
|
1682
1722
|
entity: t.string({
|
|
1683
1723
|
choices: { source: SOURCE, list: "cameras" },
|
|
1684
1724
|
placeholder: "camera.porch",
|
|
1685
|
-
label: { en: "Camera", es: "C\xE1mara" },
|
|
1686
|
-
help: { en: "Its id in Home Assistant: camera.something.", es: "Su id en Home Assistant: camera.algo." }
|
|
1725
|
+
label: { en: "Camera", es: "C\xE1mara", de: "Kamera", "zh-Hant": "\u651D\u5F71\u6A5F", "zh-Hans": "\u6444\u50CF\u5934" },
|
|
1726
|
+
help: { en: "Its id in Home Assistant: camera.something.", es: "Su id en Home Assistant: camera.algo.", de: "Ihre ID in Home Assistant: camera.irgendwas.", "zh-Hant": "\u5B83\u5728 Home Assistant \u4E2D\u7684 id\uFF1Acamera.something\u3002", "zh-Hans": "\u5B83\u5728 Home Assistant \u4E2D\u7684 id\uFF1Acamera.something\u3002" }
|
|
1687
1727
|
}),
|
|
1688
|
-
name: t.string({ label: { en: "Name", es: "Nombre" }, help: { en: "Empty = the name in Home Assistant.", es: "Vac\xEDo = el nombre en Home Assistant." } }),
|
|
1689
|
-
showName: t.boolean({ default: true, label: { en: "Show the name", es: "Mostrar el nombre" } }),
|
|
1690
|
-
showAge: t.boolean({ default: true, label: { en: "Show how old the picture is", es: "Mostrar la antig\xFCedad de la imagen" }, help: { en: "Since the picture last changed. A battery camera (Blink) only takes a new one on motion or when asked.", es: "Desde que cambi\xF3 la imagen por \xFAltima vez. Una c\xE1mara de bater\xEDa (Blink) solo hace otra con movimiento o cuando se le pide." } }),
|
|
1728
|
+
name: t.string({ label: { en: "Name", es: "Nombre", de: "Name", "zh-Hant": "\u540D\u7A31", "zh-Hans": "\u540D\u79F0" }, help: { en: "Empty = the name in Home Assistant.", es: "Vac\xEDo = el nombre en Home Assistant.", de: "Leer = der Name in Home Assistant.", "zh-Hant": "\u7559\u7A7A = \u4F7F\u7528 Home Assistant \u4E2D\u7684\u540D\u7A31\u3002", "zh-Hans": "\u7559\u7A7A = \u4F7F\u7528 Home Assistant \u4E2D\u7684\u540D\u79F0\u3002" } }),
|
|
1729
|
+
showName: t.boolean({ default: true, label: { en: "Show the name", es: "Mostrar el nombre", de: "Namen anzeigen", "zh-Hant": "\u986F\u793A\u540D\u7A31", "zh-Hans": "\u663E\u793A\u540D\u79F0" } }),
|
|
1730
|
+
showAge: t.boolean({ default: true, label: { en: "Show how old the picture is", es: "Mostrar la antig\xFCedad de la imagen", de: "Alter des Bildes anzeigen", "zh-Hant": "\u986F\u793A\u756B\u9762\u662F\u591A\u4E45\u524D\u7684", "zh-Hans": "\u663E\u793A\u753B\u9762\u662F\u591A\u4E45\u524D\u7684" }, help: { en: "Since the picture last changed. A battery camera (Blink) only takes a new one on motion or when asked.", es: "Desde que cambi\xF3 la imagen por \xFAltima vez. Una c\xE1mara de bater\xEDa (Blink) solo hace otra con movimiento o cuando se le pide.", de: "Seit sich das Bild zuletzt ge\xE4ndert hat. Eine Akku-Kamera (Blink) macht nur bei Bewegung oder auf Anfrage ein neues.", "zh-Hant": "\u81EA\u756B\u9762\u4E0A\u6B21\u8B8A\u66F4\u8D77\u7B97\u3002\u96FB\u6C60\u4F9B\u96FB\u7684\u651D\u5F71\u6A5F\uFF08Blink\uFF09\u53EA\u6709\u5075\u6E2C\u5230\u52D5\u4F5C\u6216\u6536\u5230\u8981\u6C42\u6642\u624D\u6703\u62CD\u65B0\u756B\u9762\u3002", "zh-Hans": "\u4ECE\u753B\u9762\u4E0A\u6B21\u53D8\u5316\u8D77\u7B97\u3002\u7535\u6C60\u4F9B\u7535\u7684\u6444\u50CF\u5934\uFF08Blink\uFF09\u53EA\u5728\u68C0\u6D4B\u5230\u8FD0\u52A8\u6216\u6536\u5230\u8BF7\u6C42\u65F6\u624D\u62CD\u65B0\u753B\u9762\u3002" } }),
|
|
1691
1731
|
motion: t.string({
|
|
1692
1732
|
choices: { source: SOURCE, list: "motion" },
|
|
1693
1733
|
placeholder: "binary_sensor.porch_motion",
|
|
1694
|
-
label: { en: "Motion sensor", es: "Sensor de movimiento" },
|
|
1695
|
-
help: { en: "Empty = binary_sensor.<camera>_motion if there is one (Blink names them so).", es: "Vac\xEDo = binary_sensor.<c\xE1mara>_motion si existe (Blink los llama as\xED)." }
|
|
1734
|
+
label: { en: "Motion sensor", es: "Sensor de movimiento", de: "Bewegungssensor", "zh-Hant": "\u52D5\u4F5C\u611F\u6E2C\u5668", "zh-Hans": "\u8FD0\u52A8\u4F20\u611F\u5668" },
|
|
1735
|
+
help: { en: "Empty = binary_sensor.<camera>_motion if there is one (Blink names them so).", es: "Vac\xEDo = binary_sensor.<c\xE1mara>_motion si existe (Blink los llama as\xED).", de: "Leer = binary_sensor.<kamera>_motion, falls vorhanden (so benennt Blink sie).", "zh-Hant": "\u7559\u7A7A = binary_sensor.<camera>_motion\uFF08\u82E5\u6709\u7684\u8A71\uFF1BBlink \u5C31\u662F\u9019\u6A23\u547D\u540D\uFF09\u3002", "zh-Hans": "\u7559\u7A7A = binary_sensor.<camera>_motion\uFF08\u5982\u679C\u6709\u7684\u8BDD\uFF1BBlink \u5C31\u662F\u8FD9\u6837\u547D\u540D\u7684\uFF09\u3002" }
|
|
1696
1736
|
}),
|
|
1697
1737
|
doorbell: t.string({
|
|
1698
1738
|
choices: { source: SOURCE, list: "doorbells" },
|
|
1699
1739
|
placeholder: "event.front_door_ding",
|
|
1700
|
-
label: { en: "Doorbell", es: "Timbre" },
|
|
1701
|
-
help: { en: "An event entity (event.*) or a binary sensor: for a minute after it rings, a mark on the picture, and the camera takes the tile if allowed.", es: "Una entidad de evento (event.*) o un sensor binario: durante un minuto tras sonar, una marca en la imagen, y la c\xE1mara se queda con la tesela si se le deja." }
|
|
1740
|
+
label: { en: "Doorbell", es: "Timbre", de: "T\xFCrklingel", "zh-Hant": "\u9580\u9234", "zh-Hans": "\u95E8\u94C3" },
|
|
1741
|
+
help: { en: "An event entity (event.*) or a binary sensor: for a minute after it rings, a mark on the picture, and the camera takes the tile if allowed.", es: "Una entidad de evento (event.*) o un sensor binario: durante un minuto tras sonar, una marca en la imagen, y la c\xE1mara se queda con la tesela si se le deja.", de: "Eine Ereignis-Entit\xE4t (event.*) oder ein Bin\xE4rsensor: eine Minute nach dem Klingeln eine Markierung auf dem Bild, und die Kamera \xFCbernimmt die Kachel, wenn erlaubt.", "zh-Hant": "\u4E8B\u4EF6\u5BE6\u9AD4\uFF08event.*\uFF09\u6216\u4E8C\u5143\u611F\u6E2C\u5668\uFF1A\u97FF\u9234\u5F8C\u4E00\u5206\u9418\u5167\uFF0C\u756B\u9762\u4E0A\u6703\u986F\u793A\u6A19\u8A18\uFF1B\u82E5\u5141\u8A31\uFF0C\u651D\u5F71\u6A5F\u6703\u4F54\u7528\u65B9\u683C\u3002", "zh-Hans": "\u4E8B\u4EF6\u5B9E\u4F53\uFF08event.*\uFF09\u6216\u4E8C\u5143\u4F20\u611F\u5668\uFF1A\u54CD\u94C3\u540E\u4E00\u5206\u949F\u5185\uFF0C\u753B\u9762\u4E0A\u4F1A\u663E\u793A\u6807\u8BB0\uFF1B\u82E5\u5141\u8BB8\uFF0C\u6444\u50CF\u5934\u4F1A\u5360\u7528\u683C\u5B50\u3002" }
|
|
1702
1742
|
}),
|
|
1703
|
-
fit: t.enum(["cover", "contain"], { label: { en: "Fit", es: "Ajuste" }, labels: { cover: { en: "Fill (crop)", es: "Llenar (recorta)" }, contain: { en: "Whole picture", es: "Imagen entera" } } }),
|
|
1743
|
+
fit: t.enum(["cover", "contain"], { label: { en: "Fit", es: "Ajuste", de: "Einpassen", "zh-Hant": "\u7E2E\u653E", "zh-Hans": "\u7F29\u653E" }, labels: { cover: { en: "Fill (crop)", es: "Llenar (recorta)", de: "F\xFCllen (beschneiden)", "zh-Hant": "\u586B\u6EFF\uFF08\u88C1\u5207\uFF09", "zh-Hans": "\u586B\u5145\uFF08\u88C1\u526A\uFF09" }, contain: { en: "Whole picture", es: "Imagen entera", de: "Ganzes Bild", "zh-Hant": "\u5B8C\u6574\u756B\u9762", "zh-Hans": "\u5B8C\u6574\u753B\u9762" } } }),
|
|
1704
1744
|
keep: t.enum(["center", "top", "bottom"], {
|
|
1705
1745
|
advanced: true,
|
|
1706
|
-
label: { en: "Keep in view", es: "Mantener a la vista" },
|
|
1707
|
-
labels: { center: { en: "The centre", es: "El centro" }, top: { en: "The top", es: "La parte de arriba" }, bottom: { en: "The bottom", es: "La parte de abajo" } },
|
|
1708
|
-
help: { en: "What filling crops last: the sky or the ground.", es: "Lo \xFAltimo que recorta al llenar: el cielo o el suelo." }
|
|
1746
|
+
label: { en: "Keep in view", es: "Mantener a la vista", de: "Im Blick behalten", "zh-Hant": "\u512A\u5148\u4FDD\u7559", "zh-Hans": "\u4F18\u5148\u4FDD\u7559" },
|
|
1747
|
+
labels: { center: { en: "The centre", es: "El centro", de: "Mitte", "zh-Hant": "\u4E2D\u9593", "zh-Hans": "\u4E2D\u95F4" }, top: { en: "The top", es: "La parte de arriba", de: "Oben", "zh-Hant": "\u4E0A\u65B9", "zh-Hans": "\u4E0A\u65B9" }, bottom: { en: "The bottom", es: "La parte de abajo", de: "Unten", "zh-Hant": "\u4E0B\u65B9", "zh-Hans": "\u4E0B\u65B9" } },
|
|
1748
|
+
help: { en: "What filling crops last: the sky or the ground.", es: "Lo \xFAltimo que recorta al llenar: el cielo o el suelo.", de: "Was beim F\xFCllen zuletzt abgeschnitten wird: der Himmel oder der Boden.", "zh-Hant": "\u586B\u6EFF\u6642\u6700\u5F8C\u624D\u88C1\u6389\u7684\u90E8\u5206\uFF1A\u5929\u7A7A\u6216\u5730\u9762\u3002", "zh-Hans": "\u586B\u5145\u65F6\u6700\u540E\u624D\u88C1\u6389\u7684\u90E8\u5206\uFF1A\u5929\u7A7A\u6216\u5730\u9762\u3002" }
|
|
1709
1749
|
}),
|
|
1710
|
-
dim: t.integer({ default: 0, min: 0, max: 90, step: 5, unit: "%", slider: true, advanced: true, label: { en: "Darken", es: "Oscurecer" }, help: { en: "Keeps a bright picture from outshining everything else.", es: "Para que una imagen clara no deslumbre al resto." } })
|
|
1750
|
+
dim: t.integer({ default: 0, min: 0, max: 90, step: 5, unit: "%", slider: true, advanced: true, label: { en: "Darken", es: "Oscurecer", de: "Abdunkeln", "zh-Hant": "\u8ABF\u6697", "zh-Hans": "\u8C03\u6697" }, help: { en: "Keeps a bright picture from outshining everything else.", es: "Para que una imagen clara no deslumbre al resto.", de: "Damit ein helles Bild nicht alles andere \xFCberstrahlt.", "zh-Hant": "\u907F\u514D\u660E\u4EAE\u7684\u756B\u9762\u84CB\u904E\u5176\u4ED6\u5167\u5BB9\u3002", "zh-Hans": "\u907F\u514D\u660E\u4EAE\u7684\u753B\u9762\u76D6\u8FC7\u5176\u4ED6\u5185\u5BB9\u3002" } })
|
|
1711
1751
|
}),
|
|
1712
1752
|
intervalMs: 6e4,
|
|
1713
1753
|
// Until the connection has the camera, look again soon: the first picture shouldn't wait a minute.
|
|
@@ -1772,7 +1812,7 @@ var camera = defineWidget({
|
|
|
1772
1812
|
age: options.showAge && data.changedAt ? ctx.fmt.ago(data.changedAt) : "",
|
|
1773
1813
|
motion: motion?.state === "on",
|
|
1774
1814
|
ring: !!d && ringing(options.doorbell ? d.entities[options.doorbell] : void 0, ctx.now),
|
|
1775
|
-
stale: stale ? e?.state === "unavailable" ? tr({ en: "camera unavailable", es: "c\xE1mara no disponible" }) : tr({ en: "offline", es: "sin conexi\xF3n" }) : ""
|
|
1815
|
+
stale: stale ? e?.state === "unavailable" ? tr({ en: "camera unavailable", es: "c\xE1mara no disponible", de: "Kamera nicht verf\xFCgbar", "zh-Hant": "\u651D\u5F71\u6A5F\u7121\u6CD5\u4F7F\u7528", "zh-Hans": "\u6444\u50CF\u5934\u4E0D\u53EF\u7528" }) : tr({ en: "offline", es: "sin conexi\xF3n", de: "offline", "zh-Hant": "\u96E2\u7DDA", "zh-Hans": "\u79BB\u7EBF" }) : ""
|
|
1776
1816
|
});
|
|
1777
1817
|
},
|
|
1778
1818
|
demo: ({ now, locale }) => ({
|
|
@@ -1782,12 +1822,12 @@ var camera = defineWidget({
|
|
|
1782
1822
|
})
|
|
1783
1823
|
});
|
|
1784
1824
|
function why(d, data, entity2, tr) {
|
|
1785
|
-
if (d?.state === "unconfigured") return [tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos" })];
|
|
1786
|
-
if (!entity2 || data?.state === "pick") return [tr({ en: "Choose a camera", es: "Elige una c\xE1mara" }), tr({ en: "In the inspector: one of your Home Assistant cameras, e.g. camera.porch", es: "En el inspector: una de las c\xE1maras de tu Home Assistant, p. ej. camera.porch" })];
|
|
1787
|
-
if (d?.state === "error" && !Object.keys(d.entities).length) return [tr({ en: "Home Assistant unreachable", es: "Home Assistant no responde" }), d.error];
|
|
1788
|
-
if (data?.state === "missing") return [tr({ en: "Camera not found", es: "C\xE1mara no encontrada" }), entity2];
|
|
1789
|
-
if (data?.state === "nopicture") return [tr({ en: "This camera has no picture", es: "Esta c\xE1mara no tiene imagen" }), tr({ en: "It may be off, or not a camera", es: "Puede que est\xE9 apagada, o que no sea una c\xE1mara" })];
|
|
1790
|
-
return [tr({ en: "Waiting for the camera\u2026", es: "Esperando a la c\xE1mara\u2026" })];
|
|
1825
|
+
if (d?.state === "unconfigured") return [tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar", de: "Home Assistant nicht eingerichtet", "zh-Hant": "Home Assistant \u5C1A\u672A\u8A2D\u5B9A", "zh-Hans": "Home Assistant \u5C1A\u672A\u8BBE\u7F6E" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos", de: "Adresse und Token unter Einstellungen \u2192 Datenquellen eintragen", "zh-Hant": "\u8ACB\u5728\u300C\u8A2D\u5B9A \u2192 \u8CC7\u6599\u4F86\u6E90\u300D\u4E2D\u586B\u5165\u5176\u7DB2\u5740\u548C\u6B0A\u6756", "zh-Hans": "\u8BF7\u5728\u201C\u8BBE\u7F6E \u2192 \u6570\u636E\u6E90\u201D\u4E2D\u586B\u5199\u5176\u7F51\u5740\u548C\u4EE4\u724C" })];
|
|
1826
|
+
if (!entity2 || data?.state === "pick") return [tr({ en: "Choose a camera", es: "Elige una c\xE1mara", de: "Kamera w\xE4hlen", "zh-Hant": "\u9078\u64C7\u651D\u5F71\u6A5F", "zh-Hans": "\u9009\u62E9\u6444\u50CF\u5934" }), tr({ en: "In the inspector: one of your Home Assistant cameras, e.g. camera.porch", es: "En el inspector: una de las c\xE1maras de tu Home Assistant, p. ej. camera.porch", de: "Im Inspektor: eine deiner Home-Assistant-Kameras, z. B. camera.porch", "zh-Hant": "\u5728\u6AA2\u67E5\u5668\u4E2D\uFF1A\u4F60\u7684\u67D0\u53F0 Home Assistant \u651D\u5F71\u6A5F\uFF0C\u4F8B\u5982 camera.porch", "zh-Hans": "\u5728\u68C0\u67E5\u5668\u4E2D\uFF1A\u4F60\u7684\u67D0\u4E2A Home Assistant \u6444\u50CF\u5934\uFF0C\u4F8B\u5982 camera.porch" })];
|
|
1827
|
+
if (d?.state === "error" && !Object.keys(d.entities).length) return [tr({ en: "Home Assistant unreachable", es: "Home Assistant no responde", de: "Home Assistant nicht erreichbar", "zh-Hant": "Home Assistant \u7121\u6CD5\u9023\u7DDA", "zh-Hans": "Home Assistant \u65E0\u6CD5\u8FDE\u63A5" }), errorHint(d.error, tr)];
|
|
1828
|
+
if (data?.state === "missing") return [tr({ en: "Camera not found", es: "C\xE1mara no encontrada", de: "Kamera nicht gefunden", "zh-Hant": "\u627E\u4E0D\u5230\u651D\u5F71\u6A5F", "zh-Hans": "\u627E\u4E0D\u5230\u6444\u50CF\u5934" }), entity2];
|
|
1829
|
+
if (data?.state === "nopicture") return [tr({ en: "This camera has no picture", es: "Esta c\xE1mara no tiene imagen", de: "Diese Kamera hat kein Bild", "zh-Hant": "\u9019\u53F0\u651D\u5F71\u6A5F\u6C92\u6709\u756B\u9762", "zh-Hans": "\u8FD9\u4E2A\u6444\u50CF\u5934\u6CA1\u6709\u753B\u9762" }), tr({ en: "It may be off, or not a camera", es: "Puede que est\xE9 apagada, o que no sea una c\xE1mara", de: "Vielleicht ist sie aus oder keine Kamera", "zh-Hant": "\u53EF\u80FD\u5DF2\u95DC\u9589\uFF0C\u6216\u4E0D\u662F\u651D\u5F71\u6A5F", "zh-Hans": "\u53EF\u80FD\u5DF2\u5173\u95ED\uFF0C\u6216\u4E0D\u662F\u6444\u50CF\u5934" })];
|
|
1830
|
+
return [tr({ en: "Waiting for the camera\u2026", es: "Esperando a la c\xE1mara\u2026", de: "Warte auf die Kamera\u2026", "zh-Hant": "\u6B63\u5728\u7B49\u5F85\u651D\u5F71\u6A5F\u2026", "zh-Hans": "\u6B63\u5728\u7B49\u5F85\u6444\u50CF\u5934\u2026" })];
|
|
1791
1831
|
}
|
|
1792
1832
|
function overlay(g, ctx, o) {
|
|
1793
1833
|
const { box, theme, kit } = ctx;
|
|
@@ -1829,8 +1869,8 @@ function overlay(g, ctx, o) {
|
|
|
1829
1869
|
kit.drawTracked(g, text, x + ps * (dot ? 1.55 : 0.7), y + h / 2 + ps * 0.36, { size: ps, family: fonts.sansBold, color: dot ? "#fff" : color });
|
|
1830
1870
|
x += w + ps * 0.5;
|
|
1831
1871
|
};
|
|
1832
|
-
if (o.ring) pill(ctx.t({ en: "Doorbell", es: "Llaman" }), colors.warn, true);
|
|
1833
|
-
if (o.motion) pill(ctx.t({ en: "Motion", es: "Movimiento" }), colors.alert, true);
|
|
1872
|
+
if (o.ring) pill(ctx.t({ en: "Doorbell", es: "Llaman", de: "Klingel", "zh-Hant": "\u9580\u9234", "zh-Hans": "\u95E8\u94C3" }), colors.warn, true);
|
|
1873
|
+
if (o.motion) pill(ctx.t({ en: "Motion", es: "Movimiento", de: "Bewegung", "zh-Hant": "\u6709\u52D5\u975C", "zh-Hans": "\u6709\u52A8\u9759" }), colors.alert, true);
|
|
1834
1874
|
if (o.motion || o.ring) {
|
|
1835
1875
|
g.strokeStyle = o.motion ? colors.alert : colors.warn;
|
|
1836
1876
|
g.lineWidth = Math.max(2, Math.round(s * 0.18));
|
|
@@ -1919,10 +1959,13 @@ function homeToday(e) {
|
|
|
1919
1959
|
var IDLE_W = 10;
|
|
1920
1960
|
var energy = defineWidget2({
|
|
1921
1961
|
id: "energy",
|
|
1922
|
-
name: { en: "Energy flow", es: "Flujo de energ\xEDa" },
|
|
1962
|
+
name: { en: "Energy flow", es: "Flujo de energ\xEDa", de: "Energiefluss", "zh-Hant": "\u80FD\u6E90\u6D41\u5411", "zh-Hans": "\u80FD\u6E90\u6D41\u5411" },
|
|
1923
1963
|
description: {
|
|
1924
1964
|
en: "Where the power comes from and goes, now: the grid, the solar panels and the battery around the house, a line for every flow (thicker the more it carries) and today's kWh from the Energy dashboard. A grid sensor is enough to start.",
|
|
1925
|
-
es: "De d\xF3nde viene la energ\xEDa y ad\xF3nde va, ahora: la red, las placas y la bater\xEDa alrededor de la casa, una l\xEDnea por cada flujo (m\xE1s gruesa cuanto m\xE1s lleva) y los kWh de hoy del panel de Energ\xEDa. Basta un sensor de la red para empezar."
|
|
1965
|
+
es: "De d\xF3nde viene la energ\xEDa y ad\xF3nde va, ahora: la red, las placas y la bater\xEDa alrededor de la casa, una l\xEDnea por cada flujo (m\xE1s gruesa cuanto m\xE1s lleva) y los kWh de hoy del panel de Energ\xEDa. Basta un sensor de la red para empezar.",
|
|
1966
|
+
de: "Woher der Strom gerade kommt und wohin er geht: Netz, Solaranlage und Batterie rund ums Haus, eine Linie pro Fluss (je dicker, desto mehr flie\xDFt) und die kWh von heute aus dem Energie-Dashboard. Ein Netzsensor gen\xFCgt f\xFCr den Anfang.",
|
|
1967
|
+
"zh-Hant": "\u96FB\u529B\u73FE\u5728\u5F9E\u54EA\u88E1\u4F86\u3001\u5F80\u54EA\u88E1\u53BB\uFF1A\u623F\u5B50\u5468\u570D\u662F\u96FB\u7DB2\u3001\u592A\u967D\u80FD\u677F\u548C\u96FB\u6C60\uFF0C\u6BCF\u80A1\u6D41\u5411\u4E00\u689D\u7DDA\uFF08\u6D41\u91CF\u8D8A\u5927\u8D8A\u7C97\uFF09\uFF0C\u4EE5\u53CA\u80FD\u6E90\u5100\u8868\u677F\u4E2D\u4ECA\u5929\u7684 kWh\u3002\u53EA\u8981\u6709\u96FB\u7DB2\u611F\u6E2C\u5668\u5C31\u80FD\u958B\u59CB\u3002",
|
|
1968
|
+
"zh-Hans": "\u7535\u529B\u73B0\u5728\u4ECE\u54EA\u91CC\u6765\u3001\u5230\u54EA\u91CC\u53BB\uFF1A\u623F\u5B50\u5468\u56F4\u662F\u7535\u7F51\u3001\u592A\u9633\u80FD\u677F\u548C\u7535\u6C60\uFF0C\u6BCF\u80A1\u6D41\u5411\u4E00\u6761\u7EBF\uFF08\u6D41\u91CF\u8D8A\u5927\u8D8A\u7C97\uFF09\uFF0C\u4EE5\u53CA\u80FD\u6E90\u4EEA\u8868\u76D8\u4E2D\u4ECA\u5929\u7684 kWh\u3002\u53EA\u9700\u4E00\u4E2A\u7535\u7F51\u4F20\u611F\u5668\u5373\u53EF\u5F00\u59CB\u3002"
|
|
1926
1969
|
},
|
|
1927
1970
|
icon: "zap",
|
|
1928
1971
|
category: "info",
|
|
@@ -1933,28 +1976,28 @@ var energy = defineWidget2({
|
|
|
1933
1976
|
grid: t2.string({
|
|
1934
1977
|
choices: { source: SOURCE2, list: "power" },
|
|
1935
1978
|
placeholder: "sensor.grid_power",
|
|
1936
|
-
label: { en: "Grid power", es: "Potencia de la red" },
|
|
1937
|
-
help: { en: "W or kW, positive while buying. Empty = the one in the Energy dashboard.", es: "W o kW, positiva al comprar. Vac\xEDo = la del panel de Energ\xEDa." }
|
|
1979
|
+
label: { en: "Grid power", es: "Potencia de la red", de: "Netzleistung", "zh-Hant": "\u96FB\u7DB2\u529F\u7387", "zh-Hans": "\u7535\u7F51\u529F\u7387" },
|
|
1980
|
+
help: { en: "W or kW, positive while buying. Empty = the one in the Energy dashboard.", es: "W o kW, positiva al comprar. Vac\xEDo = la del panel de Energ\xEDa.", de: "W oder kW, positiv beim Bezug. Leer = der aus dem Energie-Dashboard.", "zh-Hant": "W \u6216 kW\uFF0C\u8CB7\u96FB\u6642\u70BA\u6B63\u3002\u7559\u7A7A = \u4F7F\u7528\u80FD\u6E90\u5100\u8868\u677F\u4E2D\u7684\u8A2D\u5B9A\u3002", "zh-Hans": "W \u6216 kW\uFF0C\u4E70\u7535\u65F6\u4E3A\u6B63\u3002\u7559\u7A7A = \u4F7F\u7528\u80FD\u6E90\u4EEA\u8868\u76D8\u4E2D\u7684\u8BBE\u7F6E\u3002" }
|
|
1938
1981
|
}),
|
|
1939
|
-
gridExportPositive: t2.boolean({ label: { en: "The grid sensor is positive while selling", es: "El sensor de la red es positivo al vender" } }),
|
|
1940
|
-
solar: t2.string({ choices: { source: SOURCE2, list: "power" }, placeholder: "sensor.solar_power", label: { en: "Solar power", es: "Potencia solar" }, help: { en: "Empty = the one in the Energy dashboard, or none.", es: "Vac\xEDo = la del panel de Energ\xEDa, o ninguna." } }),
|
|
1941
|
-
battery: t2.string({ choices: { source: SOURCE2, list: "power" }, placeholder: "sensor.battery_power", label: { en: "Battery power", es: "Potencia de la bater\xEDa" }, help: { en: "Positive while discharging. Empty = the one in the Energy dashboard, or none.", es: "Positiva al descargar. Vac\xEDo = la del panel de Energ\xEDa, o ninguna." } }),
|
|
1942
|
-
batteryChargePositive: t2.boolean({ label: { en: "The battery sensor is positive while charging", es: "El sensor de la bater\xEDa es positivo al cargar" } }),
|
|
1943
|
-
batteryLevel: t2.string({ choices: { source: SOURCE2, list: "entities" }, placeholder: "sensor.battery_state_of_charge", label: { en: "Battery level", es: "Nivel de la bater\xEDa" }, help: { en: "Its %, shown in the battery.", es: "Su %, que se ve en la bater\xEDa." } }),
|
|
1944
|
-
showToday: t2.boolean({ default: true, label: { en: "Today's energy", es: "La energ\xEDa de hoy" }, help: { en: "From the Energy dashboard, under each part.", es: "Del panel de Energ\xEDa, bajo cada parte." } }),
|
|
1945
|
-
moving: t2.boolean({ default: true, label: { en: "Moving dots", es: "Puntos en movimiento" }, help: { en: "Repaints the tile every second.", es: "Vuelve a pintar la tesela cada segundo." } })
|
|
1982
|
+
gridExportPositive: t2.boolean({ label: { en: "The grid sensor is positive while selling", es: "El sensor de la red es positivo al vender", de: "Der Netzsensor ist bei Einspeisung positiv", "zh-Hant": "\u96FB\u7DB2\u611F\u6E2C\u5668\u5728\u8CE3\u96FB\u6642\u70BA\u6B63", "zh-Hans": "\u7535\u7F51\u4F20\u611F\u5668\u5728\u5356\u7535\u65F6\u4E3A\u6B63" } }),
|
|
1983
|
+
solar: t2.string({ choices: { source: SOURCE2, list: "power" }, placeholder: "sensor.solar_power", label: { en: "Solar power", es: "Potencia solar", de: "Solarleistung", "zh-Hant": "\u592A\u967D\u80FD\u529F\u7387", "zh-Hans": "\u592A\u9633\u80FD\u529F\u7387" }, help: { en: "Empty = the one in the Energy dashboard, or none.", es: "Vac\xEDo = la del panel de Energ\xEDa, o ninguna.", de: "Leer = der aus dem Energie-Dashboard oder keiner.", "zh-Hant": "\u7559\u7A7A = \u4F7F\u7528\u80FD\u6E90\u5100\u8868\u677F\u4E2D\u7684\u8A2D\u5B9A\uFF0C\u6216\u4E0D\u4F7F\u7528\u3002", "zh-Hans": "\u7559\u7A7A = \u4F7F\u7528\u80FD\u6E90\u4EEA\u8868\u76D8\u4E2D\u7684\u8BBE\u7F6E\uFF0C\u6216\u4E0D\u4F7F\u7528\u3002" } }),
|
|
1984
|
+
battery: t2.string({ choices: { source: SOURCE2, list: "power" }, placeholder: "sensor.battery_power", label: { en: "Battery power", es: "Potencia de la bater\xEDa", de: "Batterieleistung", "zh-Hant": "\u96FB\u6C60\u529F\u7387", "zh-Hans": "\u7535\u6C60\u529F\u7387" }, help: { en: "Positive while discharging. Empty = the one in the Energy dashboard, or none.", es: "Positiva al descargar. Vac\xEDo = la del panel de Energ\xEDa, o ninguna.", de: "Positiv beim Entladen. Leer = der aus dem Energie-Dashboard oder keiner.", "zh-Hant": "\u653E\u96FB\u6642\u70BA\u6B63\u3002\u7559\u7A7A = \u4F7F\u7528\u80FD\u6E90\u5100\u8868\u677F\u4E2D\u7684\u8A2D\u5B9A\uFF0C\u6216\u4E0D\u4F7F\u7528\u3002", "zh-Hans": "\u653E\u7535\u65F6\u4E3A\u6B63\u3002\u7559\u7A7A = \u4F7F\u7528\u80FD\u6E90\u4EEA\u8868\u76D8\u4E2D\u7684\u8BBE\u7F6E\uFF0C\u6216\u4E0D\u4F7F\u7528\u3002" } }),
|
|
1985
|
+
batteryChargePositive: t2.boolean({ label: { en: "The battery sensor is positive while charging", es: "El sensor de la bater\xEDa es positivo al cargar", de: "Der Batteriesensor ist beim Laden positiv", "zh-Hant": "\u96FB\u6C60\u611F\u6E2C\u5668\u5728\u5145\u96FB\u6642\u70BA\u6B63", "zh-Hans": "\u7535\u6C60\u4F20\u611F\u5668\u5728\u5145\u7535\u65F6\u4E3A\u6B63" } }),
|
|
1986
|
+
batteryLevel: t2.string({ choices: { source: SOURCE2, list: "entities" }, placeholder: "sensor.battery_state_of_charge", label: { en: "Battery level", es: "Nivel de la bater\xEDa", de: "Batteriestand", "zh-Hant": "\u96FB\u6C60\u96FB\u91CF", "zh-Hans": "\u7535\u6C60\u7535\u91CF" }, help: { en: "Its %, shown in the battery.", es: "Su %, que se ve en la bater\xEDa.", de: "Seine %, in der Batterie angezeigt.", "zh-Hant": "\u5176\u767E\u5206\u6BD4\uFF0C\u986F\u793A\u5728\u96FB\u6C60\u5716\u793A\u4E2D\u3002", "zh-Hans": "\u5176\u767E\u5206\u6BD4\uFF0C\u663E\u793A\u5728\u7535\u6C60\u56FE\u6807\u4E2D\u3002" } }),
|
|
1987
|
+
showToday: t2.boolean({ default: true, label: { en: "Today's energy", es: "La energ\xEDa de hoy", de: "Energie von heute", "zh-Hant": "\u4ECA\u5929\u7684\u96FB\u91CF", "zh-Hans": "\u4ECA\u5929\u7684\u7535\u91CF" }, help: { en: "From the Energy dashboard, under each part.", es: "Del panel de Energ\xEDa, bajo cada parte.", de: "Aus dem Energie-Dashboard, unter jedem Teil.", "zh-Hant": "\u4F86\u81EA\u80FD\u6E90\u5100\u8868\u677F\uFF0C\u986F\u793A\u5728\u5404\u90E8\u5206\u4E0B\u65B9\u3002", "zh-Hans": "\u6765\u81EA\u80FD\u6E90\u4EEA\u8868\u76D8\uFF0C\u663E\u793A\u5728\u5404\u90E8\u5206\u4E0B\u65B9\u3002" } }),
|
|
1988
|
+
moving: t2.boolean({ default: true, label: { en: "Moving dots", es: "Puntos en movimiento", de: "Bewegte Punkte", "zh-Hant": "\u6D41\u52D5\u5149\u9EDE", "zh-Hans": "\u6D41\u52A8\u5149\u70B9" }, help: { en: "Repaints the tile every second.", es: "Vuelve a pintar la tesela cada segundo.", de: "Zeichnet die Kachel jede Sekunde neu.", "zh-Hant": "\u6BCF\u79D2\u91CD\u7E6A\u65B9\u683C\u4E00\u6B21\u3002", "zh-Hans": "\u6BCF\u79D2\u91CD\u7ED8\u683C\u5B50\u4E00\u6B21\u3002" } })
|
|
1946
1989
|
}),
|
|
1947
1990
|
redraw: ({ options }) => options.moving ? "second" : "minute",
|
|
1948
1991
|
render(g, ctx) {
|
|
1949
1992
|
const { options, sources, t: tr, theme, locale } = ctx;
|
|
1950
1993
|
const d = dataOf2(sources);
|
|
1951
1994
|
const box = ctx.box;
|
|
1952
|
-
if (!d || d.state === "unconfigured") return drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos" }));
|
|
1953
|
-
if (d.state === "connecting") return drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026" }));
|
|
1995
|
+
if (!d || d.state === "unconfigured") return drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar", de: "Home Assistant nicht eingerichtet", "zh-Hant": "Home Assistant \u5C1A\u672A\u8A2D\u5B9A", "zh-Hans": "Home Assistant \u5C1A\u672A\u8BBE\u7F6E" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos", de: "Adresse und Token unter Einstellungen \u2192 Datenquellen eintragen", "zh-Hant": "\u8ACB\u5728\u300C\u8A2D\u5B9A \u2192 \u8CC7\u6599\u4F86\u6E90\u300D\u4E2D\u586B\u5165\u5176\u7DB2\u5740\u548C\u6B0A\u6756", "zh-Hans": "\u8BF7\u5728\u201C\u8BBE\u7F6E \u2192 \u6570\u636E\u6E90\u201D\u4E2D\u586B\u5199\u5176\u7F51\u5740\u548C\u4EE4\u724C" }));
|
|
1996
|
+
if (d.state === "connecting") return drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026", de: "Verbinde mit Home Assistant\u2026", "zh-Hant": "\u6B63\u5728\u9023\u7DDA Home Assistant\u2026", "zh-Hans": "\u6B63\u5728\u8FDE\u63A5 Home Assistant\u2026" }));
|
|
1954
1997
|
const ids = { grid: options.grid || d.energy?.power?.grid, solar: options.solar || d.energy?.power?.solar, battery: options.battery || d.energy?.power?.battery };
|
|
1955
1998
|
const raw = { grid: watts(ids.grid ? d.entities[ids.grid] : void 0), solar: watts(ids.solar ? d.entities[ids.solar] : void 0), battery: watts(ids.battery ? d.entities[ids.battery] : void 0) };
|
|
1956
1999
|
if (raw.grid === void 0 && raw.solar === void 0 && raw.battery === void 0) {
|
|
1957
|
-
return drawMessage(g, box, ctx, tr({ en: "Choose the power sensors", es: "Elige los sensores de potencia" }), tr({ en: "At least the grid one, in the inspector (or set them in the Energy dashboard of Home Assistant).", es: "Al menos el de la red, en el inspector (o ponlos en el panel de Energ\xEDa de Home Assistant)." }));
|
|
2000
|
+
return drawMessage(g, box, ctx, tr({ en: "Choose the power sensors", es: "Elige los sensores de potencia", de: "Leistungssensoren w\xE4hlen", "zh-Hant": "\u9078\u64C7\u529F\u7387\u611F\u6E2C\u5668", "zh-Hans": "\u9009\u62E9\u529F\u7387\u4F20\u611F\u5668" }), tr({ en: "At least the grid one, in the inspector (or set them in the Energy dashboard of Home Assistant).", es: "Al menos el de la red, en el inspector (o ponlos en el panel de Energ\xEDa de Home Assistant).", de: "Mindestens den des Netzes, im Inspektor (oder im Energie-Dashboard von Home Assistant festlegen).", "zh-Hant": "\u81F3\u5C11\u8981\u6709\u96FB\u7DB2\u7684\uFF0C\u5728\u6AA2\u67E5\u5668\u4E2D\u8A2D\u5B9A\uFF08\u6216\u5728 Home Assistant \u7684\u80FD\u6E90\u5100\u8868\u677F\u4E2D\u8A2D\u5B9A\uFF09\u3002", "zh-Hans": "\u81F3\u5C11\u8981\u6709\u7535\u7F51\u7684\uFF0C\u5728\u68C0\u67E5\u5668\u4E2D\u8BBE\u7F6E\uFF08\u6216\u5728 Home Assistant \u7684\u80FD\u6E90\u4EEA\u8868\u76D8\u4E2D\u8BBE\u7F6E\uFF09\u3002" }));
|
|
1958
2001
|
}
|
|
1959
2002
|
const p = {
|
|
1960
2003
|
...raw.grid !== void 0 ? { grid: options.gridExportPositive ? -raw.grid : raw.grid } : {},
|
|
@@ -2072,7 +2115,7 @@ var energy = defineWidget2({
|
|
|
2072
2115
|
node(at.home, "house", C.home, formatPower(f.home, locale), home !== void 0 ? [kwh(home)] : [], f.home >= IDLE_W, "below-right");
|
|
2073
2116
|
if (d.state !== "ok") {
|
|
2074
2117
|
const s = Math.max(10, Math.round(rowH * 0.8));
|
|
2075
|
-
ctx.kit.drawTracked(g, tr({ en: "offline", es: "sin conexi\xF3n" }), box.x + box.w, box.y + s, { size: s, family: theme.fonts.sans, color: theme.colors.warn, align: "right" });
|
|
2118
|
+
ctx.kit.drawTracked(g, tr({ en: "offline", es: "sin conexi\xF3n", de: "offline", "zh-Hant": "\u96E2\u7DDA", "zh-Hans": "\u79BB\u7EBF" }), box.x + box.w, box.y + s, { size: s, family: theme.fonts.sans, color: theme.colors.warn, align: "right" });
|
|
2076
2119
|
}
|
|
2077
2120
|
},
|
|
2078
2121
|
demo: ({ now, locale }) => ({ sources: { [SOURCE2]: demoHome(now, locale) }, options: { grid: "sensor.grid_power", solar: "sensor.solar_power", battery: "sensor.battery_power", batteryLevel: "sensor.battery_level" } })
|
|
@@ -2103,10 +2146,13 @@ function clock(s) {
|
|
|
2103
2146
|
}
|
|
2104
2147
|
var media = defineWidget3({
|
|
2105
2148
|
id: "media",
|
|
2106
|
-
name: { en: "Now playing", es: "Lo que suena" },
|
|
2149
|
+
name: { en: "Now playing", es: "Lo que suena", de: "L\xE4uft gerade", "zh-Hant": "\u6B63\u5728\u64AD\u653E", "zh-Hans": "\u6B63\u5728\u64AD\u653E" },
|
|
2107
2150
|
description: {
|
|
2108
2151
|
en: "What a Home Assistant media player is playing (the TV, Spotify on a speaker, a Chromecast, Sonos\u2026): cover, title, artist, the app and how far it has got. Of several, the one playing. Hides itself while nothing plays.",
|
|
2109
|
-
es: "Lo que reproduce un media player de Home Assistant (la tele, Spotify en un altavoz, un Chromecast, Sonos\u2026): car\xE1tula, t\xEDtulo, artista, la app y por d\xF3nde va. De varios, el que suena. Se oculta mientras no suena nada."
|
|
2152
|
+
es: "Lo que reproduce un media player de Home Assistant (la tele, Spotify en un altavoz, un Chromecast, Sonos\u2026): car\xE1tula, t\xEDtulo, artista, la app y por d\xF3nde va. De varios, el que suena. Se oculta mientras no suena nada.",
|
|
2153
|
+
de: "Was ein Home-Assistant-Mediaplayer gerade abspielt (der Fernseher, Spotify auf einem Lautsprecher, ein Chromecast, Sonos\u2026): Cover, Titel, K\xFCnstler, die App und wie weit es ist. Von mehreren der, der gerade spielt. Blendet sich aus, solange nichts l\xE4uft.",
|
|
2154
|
+
"zh-Hant": "Home Assistant \u5A92\u9AD4\u64AD\u653E\u5668\u6B63\u5728\u64AD\u653E\u7684\u5167\u5BB9\uFF08\u96FB\u8996\u3001\u5587\u53ED\u4E0A\u7684 Spotify\u3001Chromecast\u3001Sonos\u2026\uFF09\uFF1A\u5C01\u9762\u3001\u6A19\u984C\u3001\u6F14\u51FA\u8005\u3001\u61C9\u7528\u7A0B\u5F0F\u548C\u64AD\u653E\u9032\u5EA6\u3002\u6709\u591A\u53F0\u6642\uFF0C\u986F\u793A\u6B63\u5728\u64AD\u653E\u7684\u90A3\u53F0\u3002\u6C92\u6709\u64AD\u653E\u6642\u6703\u81EA\u52D5\u96B1\u85CF\u3002",
|
|
2155
|
+
"zh-Hans": "Home Assistant \u5A92\u4F53\u64AD\u653E\u5668\u6B63\u5728\u64AD\u653E\u7684\u5185\u5BB9\uFF08\u7535\u89C6\u3001\u97F3\u7BB1\u4E0A\u7684 Spotify\u3001Chromecast\u3001Sonos\u2026\uFF09\uFF1A\u5C01\u9762\u3001\u6807\u9898\u3001\u827A\u4EBA\u3001\u5E94\u7528\u548C\u64AD\u653E\u8FDB\u5EA6\u3002\u6709\u591A\u4E2A\u65F6\uFF0C\u663E\u793A\u6B63\u5728\u64AD\u653E\u7684\u90A3\u4E2A\u3002\u6CA1\u6709\u64AD\u653E\u65F6\u4F1A\u81EA\u52A8\u9690\u85CF\u3002"
|
|
2110
2156
|
},
|
|
2111
2157
|
icon: "music",
|
|
2112
2158
|
category: "media",
|
|
@@ -2117,11 +2163,11 @@ var media = defineWidget3({
|
|
|
2117
2163
|
entity: t3.string({
|
|
2118
2164
|
choices: { source: SOURCE3, list: "players" },
|
|
2119
2165
|
placeholder: "media_player.living_room",
|
|
2120
|
-
label: { en: "Player", es: "Reproductor" },
|
|
2121
|
-
help: { en: "One, or several with patterns (media_player.*, !media_player.kitchen): the one playing is shown. Empty = all.", es: "Uno, o varios con patrones (media_player.*, !media_player.cocina): se ve el que suena. Vac\xEDo = todos." }
|
|
2166
|
+
label: { en: "Player", es: "Reproductor", de: "Player", "zh-Hant": "\u64AD\u653E\u5668", "zh-Hans": "\u64AD\u653E\u5668" },
|
|
2167
|
+
help: { en: "One, or several with patterns (media_player.*, !media_player.kitchen): the one playing is shown. Empty = all.", es: "Uno, o varios con patrones (media_player.*, !media_player.cocina): se ve el que suena. Vac\xEDo = todos.", de: "Einer oder mehrere mit Mustern (media_player.*, !media_player.kitchen): Angezeigt wird der, der gerade spielt. Leer = alle.", "zh-Hant": "\u4E00\u53F0\uFF0C\u6216\u7528\u842C\u7528\u5B57\u5143\u6307\u5B9A\u591A\u53F0\uFF08media_player.*, !media_player.kitchen\uFF09\uFF1A\u986F\u793A\u6B63\u5728\u64AD\u653E\u7684\u90A3\u53F0\u3002\u7559\u7A7A = \u5168\u90E8\u3002", "zh-Hans": "\u4E00\u4E2A\uFF0C\u6216\u7528\u901A\u914D\u7B26\u6307\u5B9A\u591A\u4E2A\uFF08media_player.*, !media_player.kitchen\uFF09\uFF1A\u663E\u793A\u6B63\u5728\u64AD\u653E\u7684\u90A3\u4E2A\u3002\u7559\u7A7A = \u5168\u90E8\u3002" }
|
|
2122
2168
|
}),
|
|
2123
|
-
showCover: t3.boolean({ default: true, label: { en: "Show the cover", es: "Mostrar la car\xE1tula" } }),
|
|
2124
|
-
showProgress: t3.boolean({ default: true, label: { en: "Show how far it has got", es: "Mostrar por d\xF3nde va" } })
|
|
2169
|
+
showCover: t3.boolean({ default: true, label: { en: "Show the cover", es: "Mostrar la car\xE1tula", de: "Cover anzeigen", "zh-Hant": "\u986F\u793A\u5C01\u9762", "zh-Hans": "\u663E\u793A\u5C01\u9762" } }),
|
|
2170
|
+
showProgress: t3.boolean({ default: true, label: { en: "Show how far it has got", es: "Mostrar por d\xF3nde va", de: "Fortschritt anzeigen", "zh-Hant": "\u986F\u793A\u64AD\u653E\u9032\u5EA6", "zh-Hans": "\u663E\u793A\u64AD\u653E\u8FDB\u5EA6" } })
|
|
2125
2171
|
}),
|
|
2126
2172
|
intervalMs: 1e4,
|
|
2127
2173
|
timeoutMs: 2e4,
|
|
@@ -2157,11 +2203,11 @@ var media = defineWidget3({
|
|
|
2157
2203
|
const { options, sources, data, t: tr } = ctx;
|
|
2158
2204
|
const d = dataOf3(sources);
|
|
2159
2205
|
const box = ctx.box;
|
|
2160
|
-
if (!d || d.state === "unconfigured") return drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos" }));
|
|
2161
|
-
if (d.state === "connecting") return drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026" }));
|
|
2206
|
+
if (!d || d.state === "unconfigured") return drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar", de: "Home Assistant nicht eingerichtet", "zh-Hant": "Home Assistant \u5C1A\u672A\u8A2D\u5B9A", "zh-Hans": "Home Assistant \u5C1A\u672A\u8BBE\u7F6E" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos", de: "Adresse und Token unter Einstellungen \u2192 Datenquellen eintragen", "zh-Hant": "\u8ACB\u5728\u300C\u8A2D\u5B9A \u2192 \u8CC7\u6599\u4F86\u6E90\u300D\u4E2D\u586B\u5165\u5176\u7DB2\u5740\u548C\u6B0A\u6756", "zh-Hans": "\u8BF7\u5728\u201C\u8BBE\u7F6E \u2192 \u6570\u636E\u6E90\u201D\u4E2D\u586B\u5199\u5176\u7F51\u5740\u548C\u4EE4\u724C" }));
|
|
2207
|
+
if (d.state === "connecting") return drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026", de: "Verbinde mit Home Assistant\u2026", "zh-Hant": "\u6B63\u5728\u9023\u7DDA Home Assistant\u2026", "zh-Hans": "\u6B63\u5728\u8FDE\u63A5 Home Assistant\u2026" }));
|
|
2162
2208
|
const e = pickPlayer(d.entities, options.entity);
|
|
2163
|
-
if (!e) return drawMessage(g, box, ctx, tr({ en: "No media player", es: "Ning\xFAn reproductor" }), options.entity || tr({ en: "Home Assistant has none", es: "Home Assistant no tiene ninguno" }));
|
|
2164
|
-
if (!ACTIVE.has(e.state)) return drawMessage(g, box, ctx, tr({ en: "Nothing playing", es: "No suena nada" }), e.name);
|
|
2209
|
+
if (!e) return drawMessage(g, box, ctx, tr({ en: "No media player", es: "Ning\xFAn reproductor", de: "Kein Mediaplayer", "zh-Hant": "\u6C92\u6709\u5A92\u9AD4\u64AD\u653E\u5668", "zh-Hans": "\u6CA1\u6709\u5A92\u4F53\u64AD\u653E\u5668" }), options.entity || tr({ en: "Home Assistant has none", es: "Home Assistant no tiene ninguno", de: "Home Assistant hat keinen", "zh-Hant": "Home Assistant \u4E2D\u6C92\u6709\u4EFB\u4F55\u64AD\u653E\u5668", "zh-Hans": "Home Assistant \u4E2D\u6CA1\u6709\u4EFB\u4F55\u64AD\u653E\u5668" }));
|
|
2210
|
+
if (!ACTIVE.has(e.state)) return drawMessage(g, box, ctx, tr({ en: "Nothing playing", es: "No suena nada", de: "Es l\xE4uft nichts", "zh-Hant": "\u6C92\u6709\u6B63\u5728\u64AD\u653E\u7684\u5167\u5BB9", "zh-Hans": "\u6CA1\u6709\u6B63\u5728\u64AD\u653E\u7684\u5185\u5BB9" }), e.name);
|
|
2165
2211
|
paintPlayer(g, ctx, e, data);
|
|
2166
2212
|
},
|
|
2167
2213
|
demo: ({ now, locale }) => ({ sources: { [SOURCE3]: demoHome(now, locale) }, data: { demo: true }, options: { entity: "media_player.living_room_speaker" } })
|
|
@@ -2236,7 +2282,7 @@ function paintPlayer(g, ctx, e, data) {
|
|
|
2236
2282
|
kit.drawTracked(g, clock(m.duration), x + w, by + bh + to.size * 1.25, { ...to, align: "right" });
|
|
2237
2283
|
} else if (paused) {
|
|
2238
2284
|
const po = { size: Math.round(ss * 0.8), family: fonts.sans, color: colors.inkDim };
|
|
2239
|
-
kit.drawTracked(g, tr({ en: "Paused", es: "En pausa" }), x, y + po.size * 1.4, po);
|
|
2285
|
+
kit.drawTracked(g, tr({ en: "Paused", es: "En pausa", de: "Pausiert", "zh-Hant": "\u5DF2\u66AB\u505C", "zh-Hans": "\u5DF2\u6682\u505C" }), x, y + po.size * 1.4, po);
|
|
2240
2286
|
}
|
|
2241
2287
|
}
|
|
2242
2288
|
function drawDemoCover(g, x, y, s, color) {
|
|
@@ -2273,10 +2319,13 @@ function initials(name) {
|
|
|
2273
2319
|
}
|
|
2274
2320
|
var people = defineWidget4({
|
|
2275
2321
|
id: "people",
|
|
2276
|
-
name: { en: "Who is home", es: "Qui\xE9n est\xE1 en casa" },
|
|
2322
|
+
name: { en: "Who is home", es: "Qui\xE9n est\xE1 en casa", de: "Wer ist zu Hause", "zh-Hant": "\u8AB0\u5728\u5BB6", "zh-Hans": "\u8C01\u5728\u5BB6" },
|
|
2277
2323
|
description: {
|
|
2278
2324
|
en: "The people Home Assistant knows, with their photo: at home, away or in a zone of yours (Work, School), and since when.",
|
|
2279
|
-
es: "Las personas que conoce Home Assistant, con su foto: en casa, fuera o en una de tus zonas (Trabajo, Colegio), y desde cu\xE1ndo."
|
|
2325
|
+
es: "Las personas que conoce Home Assistant, con su foto: en casa, fuera o en una de tus zonas (Trabajo, Colegio), y desde cu\xE1ndo.",
|
|
2326
|
+
de: "Die Personen, die Home Assistant kennt, mit Foto: zu Hause, abwesend oder in einer deiner Zonen (Arbeit, Schule), und seit wann.",
|
|
2327
|
+
"zh-Hant": "Home Assistant \u8A8D\u5F97\u7684\u4EBA\u53CA\u5176\u7167\u7247\uFF1A\u5728\u5BB6\u3001\u5916\u51FA\u6216\u5728\u4F60\u7684\u67D0\u500B\u5340\u57DF\uFF08\u516C\u53F8\u3001\u5B78\u6821\uFF09\uFF0C\u4EE5\u53CA\u5F9E\u4F55\u6642\u958B\u59CB\u3002",
|
|
2328
|
+
"zh-Hans": "Home Assistant \u77E5\u9053\u7684\u4EBA\u5458\u53CA\u5176\u7167\u7247\uFF1A\u5728\u5BB6\u3001\u5916\u51FA\u6216\u5728\u4F60\u7684\u67D0\u4E2A\u533A\u57DF\uFF08\u516C\u53F8\u3001\u5B66\u6821\uFF09\uFF0C\u4EE5\u53CA\u4ECE\u4F55\u65F6\u5F00\u59CB\u3002"
|
|
2280
2329
|
},
|
|
2281
2330
|
icon: "users",
|
|
2282
2331
|
category: "info",
|
|
@@ -2284,9 +2333,9 @@ var people = defineWidget4({
|
|
|
2284
2333
|
size: { min: { w: 140, h: 80 }, preferred: { w: 420, h: 160 } },
|
|
2285
2334
|
sources: [SOURCE4],
|
|
2286
2335
|
options: t4.object({
|
|
2287
|
-
people: t4.filter({ choices: { source: SOURCE4, list: "people" }, label: { en: "People", es: "Personas" }, help: { en: "In this order. Empty = everyone.", es: "En este orden. Vac\xEDo = todas." } }),
|
|
2288
|
-
showSince: t4.boolean({ default: true, label: { en: "Since when", es: "Desde cu\xE1ndo" } }),
|
|
2289
|
-
homeFirst: t4.boolean({ label: { en: "Who is home first", es: "Primero quien est\xE1 en casa" } })
|
|
2336
|
+
people: t4.filter({ choices: { source: SOURCE4, list: "people" }, label: { en: "People", es: "Personas", de: "Personen", "zh-Hant": "\u4EBA\u54E1", "zh-Hans": "\u4EBA\u5458" }, help: { en: "In this order. Empty = everyone.", es: "En este orden. Vac\xEDo = todas.", de: "In dieser Reihenfolge. Leer = alle.", "zh-Hant": "\u4F9D\u6B64\u9806\u5E8F\u3002\u7559\u7A7A = \u6240\u6709\u4EBA\u3002", "zh-Hans": "\u6309\u6B64\u987A\u5E8F\u3002\u7559\u7A7A = \u6240\u6709\u4EBA\u3002" } }),
|
|
2337
|
+
showSince: t4.boolean({ default: true, label: { en: "Since when", es: "Desde cu\xE1ndo", de: "Seit wann", "zh-Hant": "\u81EA\u4F55\u6642\u8D77", "zh-Hans": "\u4ECE\u4F55\u65F6\u8D77" } }),
|
|
2338
|
+
homeFirst: t4.boolean({ label: { en: "Who is home first", es: "Primero quien est\xE1 en casa", de: "Wer zu Hause ist, zuerst", "zh-Hant": "\u5728\u5BB6\u7684\u4EBA\u512A\u5148", "zh-Hans": "\u5728\u5BB6\u7684\u4EBA\u4F18\u5148" } })
|
|
2290
2339
|
}),
|
|
2291
2340
|
intervalMs: 30 * 6e4,
|
|
2292
2341
|
async fetch({ options, sources, canvas, signal }) {
|
|
@@ -2313,19 +2362,19 @@ var people = defineWidget4({
|
|
|
2313
2362
|
const { options, sources, data, t: tr } = ctx;
|
|
2314
2363
|
const d = dataOf4(sources);
|
|
2315
2364
|
const box = ctx.box;
|
|
2316
|
-
if (!d || d.state === "unconfigured") return drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos" }));
|
|
2317
|
-
if (d.state === "connecting") return drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026" }));
|
|
2365
|
+
if (!d || d.state === "unconfigured") return drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar", de: "Home Assistant nicht eingerichtet", "zh-Hant": "Home Assistant \u5C1A\u672A\u8A2D\u5B9A", "zh-Hans": "Home Assistant \u5C1A\u672A\u8BBE\u7F6E" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos", de: "Adresse und Token unter Einstellungen \u2192 Datenquellen eintragen", "zh-Hant": "\u8ACB\u5728\u300C\u8A2D\u5B9A \u2192 \u8CC7\u6599\u4F86\u6E90\u300D\u4E2D\u586B\u5165\u5176\u7DB2\u5740\u548C\u6B0A\u6756", "zh-Hans": "\u8BF7\u5728\u201C\u8BBE\u7F6E \u2192 \u6570\u636E\u6E90\u201D\u4E2D\u586B\u5199\u5176\u7F51\u5740\u548C\u4EE4\u724C" }));
|
|
2366
|
+
if (d.state === "connecting") return drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026", de: "Verbinde mit Home Assistant\u2026", "zh-Hant": "\u6B63\u5728\u9023\u7DDA Home Assistant\u2026", "zh-Hans": "\u6B63\u5728\u8FDE\u63A5 Home Assistant\u2026" }));
|
|
2318
2367
|
let list = peopleOf(d, options.people);
|
|
2319
|
-
if (!list.length) return drawMessage(g, box, ctx, tr({ en: "Nobody", es: "Nadie" }), tr({ en: "Home Assistant has no people (Settings \u2192 People)", es: "Home Assistant no tiene personas (Ajustes \u2192 Personas)" }));
|
|
2368
|
+
if (!list.length) return drawMessage(g, box, ctx, tr({ en: "Nobody", es: "Nadie", de: "Niemand", "zh-Hant": "\u6C92\u6709\u4EBA", "zh-Hans": "\u6CA1\u6709\u4EBA" }), tr({ en: "Home Assistant has no people (Settings \u2192 People)", es: "Home Assistant no tiene personas (Ajustes \u2192 Personas)", de: "Home Assistant hat keine Personen (Einstellungen \u2192 Personen)", "zh-Hant": "Home Assistant \u4E2D\u6C92\u6709\u4EBA\u54E1\uFF08\u8A2D\u5B9A \u2192 \u4EBA\u54E1\uFF09", "zh-Hans": "Home Assistant \u4E2D\u6CA1\u6709\u4EBA\u5458\uFF08\u8BBE\u7F6E \u2192 \u4EBA\u5458\uFF09" }));
|
|
2320
2369
|
if (options.homeFirst) list = [...list].sort((a, b) => Number(b.state === "home") - Number(a.state === "home"));
|
|
2321
2370
|
paintPeople(g, ctx, list, data?.photos ?? {});
|
|
2322
2371
|
},
|
|
2323
2372
|
demo: ({ now, locale }) => ({ sources: { [SOURCE4]: demoHome(now, locale) } })
|
|
2324
2373
|
});
|
|
2325
2374
|
function whereText(e, tr) {
|
|
2326
|
-
if (e.state === "home") return tr({ en: "Home", es: "En casa" });
|
|
2327
|
-
if (e.state === "not_home") return tr({ en: "Away", es: "Fuera" });
|
|
2328
|
-
if (e.state === "unknown" || e.state === "unavailable") return tr({ en: "Unknown", es: "Sin datos" });
|
|
2375
|
+
if (e.state === "home") return tr({ en: "Home", es: "En casa", de: "Zuhause", "zh-Hant": "\u5728\u5BB6", "zh-Hans": "\u5728\u5BB6" });
|
|
2376
|
+
if (e.state === "not_home") return tr({ en: "Away", es: "Fuera", de: "Abwesend", "zh-Hant": "\u5916\u51FA", "zh-Hans": "\u5916\u51FA" });
|
|
2377
|
+
if (e.state === "unknown" || e.state === "unavailable") return tr({ en: "Unknown", es: "Sin datos", de: "Unbekannt", "zh-Hant": "\u672A\u77E5", "zh-Hans": "\u672A\u77E5" });
|
|
2329
2378
|
return e.state;
|
|
2330
2379
|
}
|
|
2331
2380
|
function paintPeople(g, ctx, list, faces) {
|
|
@@ -2381,43 +2430,49 @@ function paintPeople(g, ctx, list, faces) {
|
|
|
2381
2430
|
var SOURCE5 = "homeassistant/states";
|
|
2382
2431
|
var states = defineSource({
|
|
2383
2432
|
id: "states",
|
|
2384
|
-
name: { en: "Home Assistant", es: "Home Assistant" },
|
|
2433
|
+
name: { en: "Home Assistant", es: "Home Assistant", de: "Home Assistant", "zh-Hant": "Home Assistant", "zh-Hans": "Home Assistant" },
|
|
2385
2434
|
description: {
|
|
2386
2435
|
en: "The states of your Home Assistant entities, live over its WebSocket API (a change shows at once), and the last day of the numeric sensors for the history bars.",
|
|
2387
|
-
es: "Los estados de las entidades de tu Home Assistant, en directo por su API WebSocket (un cambio se ve al momento), y el \xFAltimo d\xEDa de los sensores num\xE9ricos para las barras de hist\xF3rico."
|
|
2436
|
+
es: "Los estados de las entidades de tu Home Assistant, en directo por su API WebSocket (un cambio se ve al momento), y el \xFAltimo d\xEDa de los sensores num\xE9ricos para las barras de hist\xF3rico.",
|
|
2437
|
+
de: "Die Zust\xE4nde deiner Home-Assistant-Entit\xE4ten, live \xFCber die WebSocket-API (eine \xC4nderung ist sofort zu sehen), und der letzte Tag der numerischen Sensoren f\xFCr die Verlaufsbalken.",
|
|
2438
|
+
"zh-Hant": "\u4F60\u7684 Home Assistant \u5BE6\u9AD4\u72C0\u614B\uFF0C\u900F\u904E\u5176 WebSocket API \u5373\u6642\u53D6\u5F97\uFF08\u8B8A\u66F4\u6703\u7ACB\u5373\u986F\u793A\uFF09\uFF0C\u4EE5\u53CA\u6578\u503C\u611F\u6E2C\u5668\u6700\u8FD1\u4E00\u5929\u7684\u8CC7\u6599\uFF0C\u4F9B\u6B77\u53F2\u9577\u689D\u4F7F\u7528\u3002",
|
|
2439
|
+
"zh-Hans": "\u4F60\u7684 Home Assistant \u5B9E\u4F53\u72B6\u6001\uFF0C\u901A\u8FC7\u5176 WebSocket API \u5B9E\u65F6\u83B7\u53D6\uFF08\u53D8\u5316\u4F1A\u7ACB\u5373\u663E\u793A\uFF09\uFF0C\u4EE5\u53CA\u6570\u503C\u4F20\u611F\u5668\u6700\u8FD1\u4E00\u5929\u7684\u6570\u636E\uFF0C\u7528\u4E8E\u5386\u53F2\u67F1\u72B6\u56FE\u3002"
|
|
2388
2440
|
},
|
|
2389
2441
|
options: t5.object({
|
|
2390
2442
|
url: t5.string({
|
|
2391
2443
|
format: "url",
|
|
2392
2444
|
risk: "network",
|
|
2393
2445
|
placeholder: "http://homeassistant.local:8123",
|
|
2394
|
-
label: { en: "Home Assistant address", es: "Direcci\xF3n de Home Assistant" },
|
|
2395
|
-
help: { en: "The one you open in the browser, e.g. http://homeassistant.local:8123 or https://home.example.com.", es: "La que abres en el navegador, p. ej. http://homeassistant.local:8123 o https://casa.example.com." }
|
|
2446
|
+
label: { en: "Home Assistant address", es: "Direcci\xF3n de Home Assistant", de: "Home-Assistant-Adresse", "zh-Hant": "Home Assistant \u7DB2\u5740", "zh-Hans": "Home Assistant \u7F51\u5740" },
|
|
2447
|
+
help: { en: "The one you open in the browser, e.g. http://homeassistant.local:8123 or https://home.example.com.", es: "La que abres en el navegador, p. ej. http://homeassistant.local:8123 o https://casa.example.com.", de: "Die, die du im Browser \xF6ffnest, z. B. http://homeassistant.local:8123 oder https://zuhause.example.com.", "zh-Hant": "\u4F60\u5728\u700F\u89BD\u5668\u4E2D\u958B\u555F\u7684\u7DB2\u5740\uFF0C\u4F8B\u5982 http://homeassistant.local:8123 \u6216 https://home.example.com\u3002", "zh-Hans": "\u4F60\u5728\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00\u7684\u7F51\u5740\uFF0C\u4F8B\u5982 http://homeassistant.local:8123 \u6216 https://home.example.com\u3002" }
|
|
2396
2448
|
}),
|
|
2397
2449
|
token: t5.string({
|
|
2398
2450
|
secret: true,
|
|
2399
|
-
label: { en: "Long-lived access token", es: "Token de acceso de larga duraci\xF3n" },
|
|
2451
|
+
label: { en: "Long-lived access token", es: "Token de acceso de larga duraci\xF3n", de: "Langlebiger Zugriffstoken", "zh-Hant": "\u9577\u671F\u5B58\u53D6\u6B0A\u6756", "zh-Hans": "\u957F\u671F\u8BBF\u95EE\u4EE4\u724C" },
|
|
2400
2452
|
help: {
|
|
2401
2453
|
en: "In Home Assistant: your profile \u2192 Security \u2192 Long-lived access tokens \u2192 Create token. A user that is not an administrator is enough.",
|
|
2402
|
-
es: "En Home Assistant: tu perfil \u2192 Seguridad \u2192 Tokens de acceso de larga duraci\xF3n \u2192 Crear token. Basta un usuario que no sea administrador."
|
|
2454
|
+
es: "En Home Assistant: tu perfil \u2192 Seguridad \u2192 Tokens de acceso de larga duraci\xF3n \u2192 Crear token. Basta un usuario que no sea administrador.",
|
|
2455
|
+
de: "In Home Assistant: dein Profil \u2192 Sicherheit \u2192 Langlebige Zugriffstoken \u2192 Token erstellen. Ein Benutzer ohne Administratorrechte gen\xFCgt.",
|
|
2456
|
+
"zh-Hant": "\u5728 Home Assistant \u4E2D\uFF1A\u4F60\u7684\u500B\u4EBA\u8CC7\u6599 \u2192 \u5B89\u5168\u6027 \u2192 \u9577\u671F\u5B58\u53D6\u6B0A\u6756 \u2192 \u5EFA\u7ACB\u6B0A\u6756\u3002\u975E\u7BA1\u7406\u54E1\u4F7F\u7528\u8005\u5373\u53EF\u3002",
|
|
2457
|
+
"zh-Hans": "\u5728 Home Assistant \u4E2D\uFF1A\u4F60\u7684\u4E2A\u4EBA\u8D44\u6599 \u2192 \u5B89\u5168 \u2192 \u957F\u671F\u8BBF\u95EE\u4EE4\u724C \u2192 \u521B\u5EFA\u4EE4\u724C\u3002\u975E\u7BA1\u7406\u5458\u7528\u6237\u5373\u53EF\u3002"
|
|
2403
2458
|
}
|
|
2404
2459
|
}),
|
|
2405
2460
|
entities: t5.filter({
|
|
2406
|
-
label: { en: "Entities to read", es: "Entidades que leer" },
|
|
2407
|
-
help: { en: "Empty = all. Ids or names, with * and !: sensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality.", es: "Vac\xEDo = todas. Ids o nombres, con * y !: sensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality." }
|
|
2461
|
+
label: { en: "Entities to read", es: "Entidades que leer", de: "Zu lesende Entit\xE4ten", "zh-Hant": "\u8981\u8B80\u53D6\u7684\u5BE6\u9AD4", "zh-Hans": "\u8981\u8BFB\u53D6\u7684\u5B9E\u4F53" },
|
|
2462
|
+
help: { en: "Empty = all. Ids or names, with * and !: sensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality.", es: "Vac\xEDo = todas. Ids o nombres, con * y !: sensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality.", de: "Leer = alle. IDs oder Namen, mit * und !: sensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality.", "zh-Hant": "\u7559\u7A7A = \u5168\u90E8\u3002\u586B id \u6216\u540D\u7A31\uFF0C\u53EF\u7528 * \u548C !\uFF1Asensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality\u3002", "zh-Hans": "\u7559\u7A7A = \u5168\u90E8\u3002\u586B id \u6216\u540D\u79F0\uFF0C\u652F\u6301 * \u548C !\uFF1Asensor.*, binary_sensor.*, lock.*, !sensor.*_linkquality\u3002" }
|
|
2408
2463
|
}),
|
|
2409
2464
|
history: t5.filter({
|
|
2410
2465
|
advanced: true,
|
|
2411
|
-
label: { en: "Entities with history", es: "Entidades con hist\xF3rico" },
|
|
2412
|
-
help: { en: "Numeric sensors whose last day is kept for the history bars. Empty = every one with a unit.", es: "Sensores num\xE9ricos de los que se guarda el \xFAltimo d\xEDa para las barras de hist\xF3rico. Vac\xEDo = todos los que tienen unidad." }
|
|
2466
|
+
label: { en: "Entities with history", es: "Entidades con hist\xF3rico", de: "Entit\xE4ten mit Verlauf", "zh-Hant": "\u4FDD\u7559\u6B77\u53F2\u7684\u5BE6\u9AD4", "zh-Hans": "\u4FDD\u7559\u5386\u53F2\u7684\u5B9E\u4F53" },
|
|
2467
|
+
help: { en: "Numeric sensors whose last day is kept for the history bars. Empty = every one with a unit.", es: "Sensores num\xE9ricos de los que se guarda el \xFAltimo d\xEDa para las barras de hist\xF3rico. Vac\xEDo = todos los que tienen unidad.", de: "Numerische Sensoren, deren letzter Tag f\xFCr die Verlaufsbalken gespeichert wird. Leer = alle mit Einheit.", "zh-Hant": "\u4FDD\u7559\u6700\u8FD1\u4E00\u5929\u8CC7\u6599\u3001\u7528\u65BC\u6B77\u53F2\u9577\u689D\u7684\u6578\u503C\u611F\u6E2C\u5668\u3002\u7559\u7A7A = \u6240\u6709\u6709\u55AE\u4F4D\u7684\u611F\u6E2C\u5668\u3002", "zh-Hans": "\u4FDD\u7559\u6700\u8FD1\u4E00\u5929\u6570\u636E\u3001\u7528\u4E8E\u5386\u53F2\u67F1\u72B6\u56FE\u7684\u6570\u503C\u4F20\u611F\u5668\u3002\u7559\u7A7A = \u6240\u6709\u5E26\u5355\u4F4D\u7684\u4F20\u611F\u5668\u3002" }
|
|
2413
2468
|
}),
|
|
2414
2469
|
maxHistory: t5.integer({
|
|
2415
2470
|
default: 100,
|
|
2416
2471
|
min: 0,
|
|
2417
2472
|
max: 1e3,
|
|
2418
2473
|
advanced: true,
|
|
2419
|
-
label: { en: "Most entities with history", es: "M\xE1ximo de entidades con hist\xF3rico" },
|
|
2420
|
-
help: { en: "Each costs a day of five-minute averages in memory (about 300 numbers). 0 = no history.", es: "Cada una ocupa un d\xEDa de medias de cinco minutos en memoria (unos 300 n\xFAmeros). 0 = sin hist\xF3rico." }
|
|
2474
|
+
label: { en: "Most entities with history", es: "M\xE1ximo de entidades con hist\xF3rico", de: "H\xF6chstzahl an Entit\xE4ten mit Verlauf", "zh-Hant": "\u4FDD\u7559\u6B77\u53F2\u7684\u5BE6\u9AD4\u4E0A\u9650", "zh-Hans": "\u4FDD\u7559\u5386\u53F2\u7684\u5B9E\u4F53\u4E0A\u9650" },
|
|
2475
|
+
help: { en: "Each costs a day of five-minute averages in memory (about 300 numbers). 0 = no history.", es: "Cada una ocupa un d\xEDa de medias de cinco minutos en memoria (unos 300 n\xFAmeros). 0 = sin hist\xF3rico.", de: "Jede belegt einen Tag an F\xFCnf-Minuten-Mittelwerten im Speicher (etwa 300 Zahlen). 0 = kein Verlauf.", "zh-Hant": "\u6BCF\u500B\u5BE6\u9AD4\u6703\u5728\u8A18\u61B6\u9AD4\u4E2D\u4F54\u7528\u4E00\u5929\u7684\u4E94\u5206\u9418\u5E73\u5747\u503C\uFF08\u7D04 300 \u500B\u6578\u5B57\uFF09\u30020 = \u4E0D\u4FDD\u7559\u6B77\u53F2\u3002", "zh-Hans": "\u6BCF\u4E2A\u5B9E\u4F53\u4F1A\u5728\u5185\u5B58\u4E2D\u5360\u7528\u4E00\u5929\u7684\u4E94\u5206\u949F\u5E73\u5747\u503C\uFF08\u7EA6 300 \u4E2A\u6570\u5B57\uFF09\u30020 = \u4E0D\u4FDD\u7559\u5386\u53F2\u3002" }
|
|
2421
2476
|
})
|
|
2422
2477
|
}),
|
|
2423
2478
|
watch: (ctx, emit) => connect({ url: ctx.options.url, token: ctx.options.token, entities: ctx.options.entities, history: ctx.options.history, maxHistory: ctx.options.maxHistory }, emit, { signal: ctx.signal, log: ctx.log }),
|
|
@@ -2442,35 +2497,38 @@ function frame(g, box, ctx, data) {
|
|
|
2442
2497
|
if (!data) return null;
|
|
2443
2498
|
const tr = ctx.t;
|
|
2444
2499
|
if (data.state === "unconfigured") {
|
|
2445
|
-
drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos" }));
|
|
2500
|
+
drawMessage(g, box, ctx, tr({ en: "Home Assistant not set up", es: "Home Assistant sin configurar", de: "Home Assistant nicht eingerichtet", "zh-Hant": "Home Assistant \u5C1A\u672A\u8A2D\u5B9A", "zh-Hans": "Home Assistant \u5C1A\u672A\u8BBE\u7F6E" }), tr({ en: "Set its address and a token in Settings \u2192 Data sources", es: "Pon su direcci\xF3n y un token en Ajustes \u2192 Fuentes de datos", de: "Adresse und Token unter Einstellungen \u2192 Datenquellen eintragen", "zh-Hant": "\u8ACB\u5728\u300C\u8A2D\u5B9A \u2192 \u8CC7\u6599\u4F86\u6E90\u300D\u4E2D\u586B\u5165\u5176\u7DB2\u5740\u548C\u6B0A\u6756", "zh-Hans": "\u8BF7\u5728\u201C\u8BBE\u7F6E \u2192 \u6570\u636E\u6E90\u201D\u4E2D\u586B\u5199\u5176\u7F51\u5740\u548C\u4EE4\u724C" }));
|
|
2446
2501
|
return null;
|
|
2447
2502
|
}
|
|
2448
2503
|
if (data.state === "connecting") {
|
|
2449
|
-
drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026" }));
|
|
2504
|
+
drawMessage(g, box, ctx, tr({ en: "Connecting to Home Assistant\u2026", es: "Conectando con Home Assistant\u2026", de: "Verbinde mit Home Assistant\u2026", "zh-Hant": "\u6B63\u5728\u9023\u7DDA Home Assistant\u2026", "zh-Hans": "\u6B63\u5728\u8FDE\u63A5 Home Assistant\u2026" }));
|
|
2450
2505
|
return null;
|
|
2451
2506
|
}
|
|
2452
2507
|
if (data.state === "error" && !Object.keys(data.entities).length) {
|
|
2453
|
-
drawMessage(g, box, ctx, tr({ en: "Home Assistant unreachable", es: "Home Assistant no responde" }), data.error);
|
|
2508
|
+
drawMessage(g, box, ctx, tr({ en: "Home Assistant unreachable", es: "Home Assistant no responde", de: "Home Assistant nicht erreichbar", "zh-Hant": "Home Assistant \u7121\u6CD5\u9023\u7DDA", "zh-Hans": "Home Assistant \u65E0\u6CD5\u8FDE\u63A5" }), errorHint(data.error, tr));
|
|
2454
2509
|
return null;
|
|
2455
2510
|
}
|
|
2456
2511
|
if (data.state === "ok") return box;
|
|
2457
2512
|
const { colors, fonts } = ctx.theme;
|
|
2458
2513
|
const s = Math.max(10, Math.round(Math.min(18, box.h * 0.12)));
|
|
2459
|
-
const hint = data.since ? `${tr({ en: "offline since", es: "sin conexi\xF3n desde las" })} ${ctx.fmt.time(data.since)}` : tr({ en: "offline", es: "sin conexi\xF3n" });
|
|
2514
|
+
const hint = data.since ? `${tr({ en: "offline since", es: "sin conexi\xF3n desde las", de: "offline seit", "zh-Hant": "\u96E2\u7DDA\u59CB\u65BC", "zh-Hans": "\u79BB\u7EBF\u59CB\u4E8E" })} ${ctx.fmt.time(data.since)}` : tr({ en: "offline", es: "sin conexi\xF3n", de: "offline", "zh-Hant": "\u96E2\u7DDA", "zh-Hans": "\u79BB\u7EBF" });
|
|
2460
2515
|
ctx.kit.drawTracked(g, ctx.kit.truncate(g, hint, box.w, { size: s, family: fonts.sans }), box.x + box.w, box.y + box.h - s * 0.25, { size: s, family: fonts.sans, color: colors.warn, align: "right" });
|
|
2461
2516
|
return { ...box, h: box.h - s * 1.4 };
|
|
2462
2517
|
}
|
|
2463
2518
|
var live = (d) => !!d && (d.state === "ok" || d.state === "offline" || d.state === "error" && Object.keys(d.entities).length > 0);
|
|
2464
2519
|
var batteryFields = () => ({
|
|
2465
|
-
batteryWarn: t5.integer({ default: 20, min: 0, max: 100, unit: "%", advanced: true, label: { en: "Battery warning at", es: "Bater\xEDa en aviso desde" } }),
|
|
2466
|
-
batteryAlert: t5.integer({ default: 10, min: 0, max: 100, unit: "%", advanced: true, label: { en: "Battery alert at", es: "Bater\xEDa en alerta desde" } })
|
|
2520
|
+
batteryWarn: t5.integer({ default: 20, min: 0, max: 100, unit: "%", advanced: true, label: { en: "Battery warning at", es: "Bater\xEDa en aviso desde", de: "Batteriewarnung ab", "zh-Hant": "\u96FB\u6C60\u8B66\u544A\u9580\u6ABB", "zh-Hans": "\u7535\u6C60\u8B66\u544A\u9608\u503C" } }),
|
|
2521
|
+
batteryAlert: t5.integer({ default: 10, min: 0, max: 100, unit: "%", advanced: true, label: { en: "Battery alert at", es: "Bater\xEDa en alerta desde", de: "Batteriealarm ab", "zh-Hant": "\u96FB\u6C60\u8B66\u5831\u9580\u6ABB", "zh-Hans": "\u7535\u6C60\u544A\u8B66\u9608\u503C" } })
|
|
2467
2522
|
});
|
|
2468
2523
|
var entity = defineWidget5({
|
|
2469
2524
|
id: "entity",
|
|
2470
|
-
name: { en: "Entity", es: "Entidad" },
|
|
2525
|
+
name: { en: "Entity", es: "Entidad", de: "Entit\xE4t", "zh-Hant": "\u5BE6\u9AD4", "zh-Hans": "\u5B9E\u4F53" },
|
|
2471
2526
|
description: {
|
|
2472
2527
|
en: "One Home Assistant entity in big: a temperature, the power the house draws, a door, the thermostat. Numeric sensors can show their last hours as bars, and turn amber or red past thresholds of your own.",
|
|
2473
|
-
es: "Una entidad de Home Assistant en grande: una temperatura, lo que consume la casa, una puerta, el termostato. Los sensores num\xE9ricos pueden mostrar sus \xFAltimas horas en barras y ponerse en \xE1mbar o rojo al pasar los umbrales que elijas."
|
|
2528
|
+
es: "Una entidad de Home Assistant en grande: una temperatura, lo que consume la casa, una puerta, el termostato. Los sensores num\xE9ricos pueden mostrar sus \xFAltimas horas en barras y ponerse en \xE1mbar o rojo al pasar los umbrales que elijas.",
|
|
2529
|
+
de: "Eine Home-Assistant-Entit\xE4t in gro\xDF: eine Temperatur, der Stromverbrauch des Hauses, eine T\xFCr, das Thermostat. Numerische Sensoren k\xF6nnen ihre letzten Stunden als Balken zeigen und jenseits eigener Schwellenwerte gelb oder rot werden.",
|
|
2530
|
+
"zh-Hant": "\u4EE5\u5927\u5B57\u986F\u793A\u4E00\u500B Home Assistant \u5BE6\u9AD4\uFF1A\u6EAB\u5EA6\u3001\u5BB6\u4E2D\u7684\u7528\u96FB\u529F\u7387\u3001\u4E00\u6247\u9580\u3001\u6EAB\u63A7\u5668\u3002\u6578\u503C\u611F\u6E2C\u5668\u53EF\u7528\u9577\u689D\u986F\u793A\u6700\u8FD1\u5E7E\u5C0F\u6642\uFF0C\u8D85\u904E\u4F60\u8A2D\u5B9A\u7684\u9580\u6ABB\u6642\u6703\u8B8A\u6210\u7425\u73C0\u8272\u6216\u7D05\u8272\u3002",
|
|
2531
|
+
"zh-Hans": "\u4EE5\u5927\u5B57\u663E\u793A\u4E00\u4E2A Home Assistant \u5B9E\u4F53\uFF1A\u6E29\u5EA6\u3001\u5BB6\u91CC\u7684\u7528\u7535\u529F\u7387\u3001\u4E00\u6247\u95E8\u3001\u6E29\u63A7\u5668\u3002\u6570\u503C\u4F20\u611F\u5668\u53EF\u7528\u67F1\u72B6\u56FE\u663E\u793A\u6700\u8FD1\u51E0\u5C0F\u65F6\uFF0C\u8D85\u8FC7\u4F60\u8BBE\u5B9A\u7684\u9608\u503C\u65F6\u4F1A\u53D8\u4E3A\u7425\u73C0\u8272\u6216\u7EA2\u8272\u3002"
|
|
2474
2532
|
},
|
|
2475
2533
|
icon: "gauge",
|
|
2476
2534
|
category: "info",
|
|
@@ -2481,21 +2539,21 @@ var entity = defineWidget5({
|
|
|
2481
2539
|
entity: t5.string({
|
|
2482
2540
|
choices: { source: SOURCE5, list: "entities" },
|
|
2483
2541
|
placeholder: "sensor.living_room_temperature",
|
|
2484
|
-
label: { en: "Entity", es: "Entidad" },
|
|
2485
|
-
help: { en: "Its id, as in Home Assistant \u2192 Settings \u2192 Devices & services \u2192 Entities.", es: "Su id, como en Home Assistant \u2192 Ajustes \u2192 Dispositivos y servicios \u2192 Entidades." }
|
|
2542
|
+
label: { en: "Entity", es: "Entidad", de: "Entit\xE4t", "zh-Hant": "\u5BE6\u9AD4", "zh-Hans": "\u5B9E\u4F53" },
|
|
2543
|
+
help: { en: "Its id, as in Home Assistant \u2192 Settings \u2192 Devices & services \u2192 Entities.", es: "Su id, como en Home Assistant \u2192 Ajustes \u2192 Dispositivos y servicios \u2192 Entidades.", de: "Ihre ID, wie unter Home Assistant \u2192 Einstellungen \u2192 Ger\xE4te & Dienste \u2192 Entit\xE4ten.", "zh-Hant": "\u5B83\u7684 id\uFF0C\u5373 Home Assistant \u2192 \u8A2D\u5B9A \u2192 \u88DD\u7F6E\u8207\u670D\u52D9 \u2192 \u5BE6\u9AD4\u4E2D\u6240\u5217\u7684\u3002", "zh-Hans": "\u5B83\u7684 id\uFF0C\u5373 Home Assistant \u2192 \u8BBE\u7F6E \u2192 \u8BBE\u5907\u4E0E\u670D\u52A1 \u2192 \u5B9E\u4F53\u4E2D\u6240\u5217\u7684\u3002" }
|
|
2486
2544
|
}),
|
|
2487
|
-
name: t5.string({ label: { en: "Name", es: "Nombre" }, help: { en: "Empty = the name in Home Assistant.", es: "Vac\xEDo = el nombre en Home Assistant." } }),
|
|
2488
|
-
showName: t5.boolean({ default: true, label: { en: "Show the name", es: "Mostrar el nombre" } }),
|
|
2489
|
-
showHistory: t5.boolean({ default: true, label: { en: "Show the history", es: "Mostrar el hist\xF3rico" }, help: { en: "Numeric sensors only, when the source keeps their history.", es: "Solo sensores num\xE9ricos cuyo hist\xF3rico guarda la fuente." } }),
|
|
2490
|
-
historyMs: t5.duration({ default: 24 * 36e5, min: 36e5, max: 24 * 36e5, label: { en: "History span", es: "Periodo del hist\xF3rico" } }),
|
|
2491
|
-
decimals: t5.integer({ default: -1, min: -1, max: 4, advanced: true, label: { en: "Decimals", es: "Decimales" }, help: { en: "-1 = automatic: fewer as the number grows.", es: "-1 = autom\xE1tico: menos cuanto mayor es el n\xFAmero." } }),
|
|
2545
|
+
name: t5.string({ label: { en: "Name", es: "Nombre", de: "Name", "zh-Hant": "\u540D\u7A31", "zh-Hans": "\u540D\u79F0" }, help: { en: "Empty = the name in Home Assistant.", es: "Vac\xEDo = el nombre en Home Assistant.", de: "Leer = der Name in Home Assistant.", "zh-Hant": "\u7559\u7A7A = \u4F7F\u7528 Home Assistant \u4E2D\u7684\u540D\u7A31\u3002", "zh-Hans": "\u7559\u7A7A = \u4F7F\u7528 Home Assistant \u4E2D\u7684\u540D\u79F0\u3002" } }),
|
|
2546
|
+
showName: t5.boolean({ default: true, label: { en: "Show the name", es: "Mostrar el nombre", de: "Namen anzeigen", "zh-Hant": "\u986F\u793A\u540D\u7A31", "zh-Hans": "\u663E\u793A\u540D\u79F0" } }),
|
|
2547
|
+
showHistory: t5.boolean({ default: true, label: { en: "Show the history", es: "Mostrar el hist\xF3rico", de: "Verlauf anzeigen", "zh-Hant": "\u986F\u793A\u6B77\u53F2", "zh-Hans": "\u663E\u793A\u5386\u53F2" }, help: { en: "Numeric sensors only, when the source keeps their history.", es: "Solo sensores num\xE9ricos cuyo hist\xF3rico guarda la fuente.", de: "Nur numerische Sensoren, deren Verlauf die Datenquelle speichert.", "zh-Hant": "\u50C5\u9650\u6578\u503C\u611F\u6E2C\u5668\uFF0C\u4E14\u8CC7\u6599\u4F86\u6E90\u6709\u4FDD\u7559\u5176\u6B77\u53F2\u6642\u3002", "zh-Hans": "\u4EC5\u9650\u6570\u503C\u4F20\u611F\u5668\uFF0C\u4E14\u6570\u636E\u6E90\u4FDD\u7559\u4E86\u5176\u5386\u53F2\u65F6\u3002" } }),
|
|
2548
|
+
historyMs: t5.duration({ default: 24 * 36e5, min: 36e5, max: 24 * 36e5, label: { en: "History span", es: "Periodo del hist\xF3rico", de: "Verlaufszeitraum", "zh-Hant": "\u6B77\u53F2\u7BC4\u570D", "zh-Hans": "\u5386\u53F2\u8303\u56F4" } }),
|
|
2549
|
+
decimals: t5.integer({ default: -1, min: -1, max: 4, advanced: true, label: { en: "Decimals", es: "Decimales", de: "Nachkommastellen", "zh-Hant": "\u5C0F\u6578\u4F4D\u6578", "zh-Hans": "\u5C0F\u6570\u4F4D\u6570" }, help: { en: "-1 = automatic: fewer as the number grows.", es: "-1 = autom\xE1tico: menos cuanto mayor es el n\xFAmero.", de: "-1 = automatisch: weniger, je gr\xF6\xDFer die Zahl.", "zh-Hant": "-1 = \u81EA\u52D5\uFF1A\u6578\u5B57\u8D8A\u5927\uFF0C\u5C0F\u6578\u4F4D\u8D8A\u5C11\u3002", "zh-Hans": "-1 = \u81EA\u52A8\uFF1A\u6570\u5B57\u8D8A\u5927\uFF0C\u5C0F\u6570\u4F4D\u8D8A\u5C11\u3002" } }),
|
|
2492
2550
|
thresholds: t5.enum(["off", "above", "below"], {
|
|
2493
2551
|
default: "off",
|
|
2494
|
-
label: { en: "Thresholds", es: "Umbrales" },
|
|
2495
|
-
labels: { off: { en: "Off", es: "No" }, above: { en: "Warn above", es: "Avisar por encima" }, below: { en: "Warn below", es: "Avisar por debajo" } }
|
|
2552
|
+
label: { en: "Thresholds", es: "Umbrales", de: "Schwellenwerte", "zh-Hant": "\u9580\u6ABB", "zh-Hans": "\u9608\u503C" },
|
|
2553
|
+
labels: { off: { en: "Off", es: "No", de: "Aus", "zh-Hant": "\u95DC\u9589", "zh-Hans": "\u5173\u95ED" }, above: { en: "Warn above", es: "Avisar por encima", de: "Warnen \xFCber", "zh-Hant": "\u9AD8\u65BC\u6642\u8B66\u544A", "zh-Hans": "\u9AD8\u4E8E\u65F6\u8B66\u544A" }, below: { en: "Warn below", es: "Avisar por debajo", de: "Warnen unter", "zh-Hant": "\u4F4E\u65BC\u6642\u8B66\u544A", "zh-Hans": "\u4F4E\u4E8E\u65F6\u8B66\u544A" } }
|
|
2496
2554
|
}),
|
|
2497
|
-
warn: t5.number({ default: 0, min: -1e6, max: 1e6, label: { en: "Warning (amber) at", es: "Aviso (\xE1mbar) en" } }),
|
|
2498
|
-
alert: t5.number({ default: 0, min: -1e6, max: 1e6, label: { en: "Alert (red) at", es: "Alerta (rojo) en" }, help: { en: "Red, and the widget keeps its tile.", es: "Rojo, y el widget se queda con su tesela." } })
|
|
2555
|
+
warn: t5.number({ default: 0, min: -1e6, max: 1e6, label: { en: "Warning (amber) at", es: "Aviso (\xE1mbar) en", de: "Warnung (gelb) bei", "zh-Hant": "\u8B66\u544A\uFF08\u7425\u73C0\u8272\uFF09\u9580\u6ABB", "zh-Hans": "\u8B66\u544A\uFF08\u7425\u73C0\u8272\uFF09\u9608\u503C" } }),
|
|
2556
|
+
alert: t5.number({ default: 0, min: -1e6, max: 1e6, label: { en: "Alert (red) at", es: "Alerta (rojo) en", de: "Alarm (rot) bei", "zh-Hant": "\u8B66\u5831\uFF08\u7D05\u8272\uFF09\u9580\u6ABB", "zh-Hans": "\u544A\u8B66\uFF08\u7EA2\u8272\uFF09\u9608\u503C" }, help: { en: "Red, and the widget keeps its tile.", es: "Rojo, y el widget se queda con su tesela.", de: "Rot, und das Widget beh\xE4lt seine Kachel.", "zh-Hant": "\u7D05\u8272\uFF0C\u4E14\u5C0F\u5DE5\u5177\u6703\u4FDD\u6709\u5176\u65B9\u683C\u3002", "zh-Hans": "\u7EA2\u8272\uFF0C\u4E14\u5C0F\u7EC4\u4EF6\u4F1A\u4FDD\u7559\u5176\u683C\u5B50\u3002" } })
|
|
2499
2557
|
}),
|
|
2500
2558
|
redraw: "minute",
|
|
2501
2559
|
urgent: ({ options, sources }) => {
|
|
@@ -2507,18 +2565,21 @@ var entity = defineWidget5({
|
|
|
2507
2565
|
const data = dataOf5(sources);
|
|
2508
2566
|
const box = frame(g, ctx.box, ctx, data);
|
|
2509
2567
|
if (!box || !data) return;
|
|
2510
|
-
if (!options.entity) return drawMessage(g, box, ctx, tr({ en: "Choose an entity", es: "Elige una entidad" }), tr({ en: "Its id in the inspector, e.g. sensor.living_room_temperature", es: "Su id en el inspector, p. ej. sensor.living_room_temperature" }));
|
|
2511
|
-
if (!data.entities[options.entity]) return drawMessage(g, box, ctx, tr({ en: "Entity not found", es: "Entidad no encontrada" }), options.entity);
|
|
2568
|
+
if (!options.entity) return drawMessage(g, box, ctx, tr({ en: "Choose an entity", es: "Elige una entidad", de: "Entit\xE4t w\xE4hlen", "zh-Hant": "\u9078\u64C7\u5BE6\u9AD4", "zh-Hans": "\u9009\u62E9\u5B9E\u4F53" }), tr({ en: "Its id in the inspector, e.g. sensor.living_room_temperature", es: "Su id en el inspector, p. ej. sensor.living_room_temperature", de: "Ihre ID im Inspektor, z. B. sensor.living_room_temperature", "zh-Hant": "\u5728\u6AA2\u67E5\u5668\u4E2D\u586B\u5165\u5176 id\uFF0C\u4F8B\u5982 sensor.living_room_temperature", "zh-Hans": "\u5728\u68C0\u67E5\u5668\u4E2D\u586B\u5199\u5176 id\uFF0C\u4F8B\u5982 sensor.living_room_temperature" }));
|
|
2569
|
+
if (!data.entities[options.entity]) return drawMessage(g, box, ctx, tr({ en: "Entity not found", es: "Entidad no encontrada", de: "Entit\xE4t nicht gefunden", "zh-Hant": "\u627E\u4E0D\u5230\u5BE6\u9AD4", "zh-Hans": "\u627E\u4E0D\u5230\u5B9E\u4F53" }), options.entity);
|
|
2512
2570
|
renderEntity(g, ctx, data, box);
|
|
2513
2571
|
},
|
|
2514
2572
|
demo: ({ now, locale }) => ({ ...demo({ now, locale }), options: { entity: "sensor.living_room_temperature" } })
|
|
2515
2573
|
});
|
|
2516
2574
|
var entities = defineWidget5({
|
|
2517
2575
|
id: "entities",
|
|
2518
|
-
name: { en: "Entities", es: "Entidades" },
|
|
2576
|
+
name: { en: "Entities", es: "Entidades", de: "Entit\xE4ten", "zh-Hant": "\u5BE6\u9AD4", "zh-Hans": "\u5B9E\u4F53" },
|
|
2519
2577
|
description: {
|
|
2520
2578
|
en: "A list of Home Assistant entities and their states, picked by id or name with patterns (sensor.*_temperature, light.*). Open doors, low batteries and alarms are coloured; the rest stays quiet.",
|
|
2521
|
-
es: "Una lista de entidades de Home Assistant con sus estados, elegidas por id o nombre con patrones (sensor.*_temperature, light.*). Puertas abiertas, bater\xEDas bajas y alarmas llevan color; el resto, discreto."
|
|
2579
|
+
es: "Una lista de entidades de Home Assistant con sus estados, elegidas por id o nombre con patrones (sensor.*_temperature, light.*). Puertas abiertas, bater\xEDas bajas y alarmas llevan color; el resto, discreto.",
|
|
2580
|
+
de: "Eine Liste von Home-Assistant-Entit\xE4ten mit ihren Zust\xE4nden, ausgew\xE4hlt nach ID oder Name mit Mustern (sensor.*_temperature, light.*). Offene T\xFCren, schwache Batterien und Alarme sind farbig; der Rest bleibt unauff\xE4llig.",
|
|
2581
|
+
"zh-Hant": "\u4E00\u4EFD Home Assistant \u5BE6\u9AD4\u53CA\u5176\u72C0\u614B\u7684\u6E05\u55AE\uFF0C\u4F9D id \u6216\u540D\u7A31\u4EE5\u842C\u7528\u5B57\u5143\u6311\u9078\uFF08sensor.*_temperature, light.*\uFF09\u3002\u958B\u8457\u7684\u9580\u3001\u96FB\u91CF\u4F4E\u7684\u96FB\u6C60\u548C\u8B66\u5831\u6703\u4EE5\u984F\u8272\u6A19\u793A\uFF1B\u5176\u9918\u4FDD\u6301\u4F4E\u8ABF\u3002",
|
|
2582
|
+
"zh-Hans": "\u4E00\u4E2A Home Assistant \u5B9E\u4F53\u53CA\u5176\u72B6\u6001\u7684\u5217\u8868\uFF0C\u6309 id \u6216\u540D\u79F0\u7528\u901A\u914D\u7B26\u6311\u9009\uFF08sensor.*_temperature, light.*\uFF09\u3002\u5F00\u7740\u7684\u95E8\u3001\u7535\u91CF\u4F4E\u7684\u7535\u6C60\u548C\u8B66\u62A5\u4F1A\u7528\u989C\u8272\u6807\u51FA\uFF1B\u5176\u4F59\u4FDD\u6301\u4F4E\u8C03\u3002"
|
|
2522
2583
|
},
|
|
2523
2584
|
icon: "list",
|
|
2524
2585
|
category: "info",
|
|
@@ -2529,12 +2590,12 @@ var entities = defineWidget5({
|
|
|
2529
2590
|
...listOptions({ layouts: ["one-line", "detailed"] }),
|
|
2530
2591
|
entities: t5.filter({
|
|
2531
2592
|
choices: { source: SOURCE5, list: "entities" },
|
|
2532
|
-
label: { en: "Entities", es: "Entidades" },
|
|
2533
|
-
help: { en: "Ids or names, in the order to list them: sensor.*_temperature, light.*, *kitchen*, !light.porch. Empty = all.", es: "Ids o nombres, en el orden en que listarlas: sensor.*_temperature, light.*, *cocina*, !light.porch. Vac\xEDo = todas." }
|
|
2593
|
+
label: { en: "Entities", es: "Entidades", de: "Entit\xE4ten", "zh-Hant": "\u5BE6\u9AD4", "zh-Hans": "\u5B9E\u4F53" },
|
|
2594
|
+
help: { en: "Ids or names, in the order to list them: sensor.*_temperature, light.*, *kitchen*, !light.porch. Empty = all.", es: "Ids o nombres, en el orden en que listarlas: sensor.*_temperature, light.*, *cocina*, !light.porch. Vac\xEDo = todas.", de: "IDs oder Namen, in der Reihenfolge der Liste: sensor.*_temperature, light.*, *k\xFCche*, !light.porch. Leer = alle.", "zh-Hant": "id \u6216\u540D\u7A31\uFF0C\u4F9D\u5217\u51FA\u7684\u9806\u5E8F\uFF1Asensor.*_temperature, light.*, *kitchen*, !light.porch\u3002\u7559\u7A7A = \u5168\u90E8\u3002", "zh-Hans": "id \u6216\u540D\u79F0\uFF0C\u6309\u5217\u51FA\u7684\u987A\u5E8F\uFF1Asensor.*_temperature, light.*, *kitchen*, !light.porch\u3002\u7559\u7A7A = \u5168\u90E8\u3002" }
|
|
2534
2595
|
}),
|
|
2535
|
-
hideOff: t5.boolean({ label: { en: "Only what is on, open or wrong", es: "Solo lo encendido, abierto o con problemas" }, help: { en: "Leaves out what is off or closed. Numbers always stay.", es: "Deja fuera lo apagado o cerrado. Los n\xFAmeros se quedan siempre." } }),
|
|
2536
|
-
hideUnavailable: t5.boolean({ label: { en: "Hide unavailable entities", es: "Ocultar las entidades no disponibles" } }),
|
|
2537
|
-
decimals: t5.integer({ default: -1, min: -1, max: 4, advanced: true, label: { en: "Decimals", es: "Decimales" }, help: { en: "-1 = automatic.", es: "-1 = autom\xE1tico." } }),
|
|
2596
|
+
hideOff: t5.boolean({ label: { en: "Only what is on, open or wrong", es: "Solo lo encendido, abierto o con problemas", de: "Nur was an, offen oder gest\xF6rt ist", "zh-Hant": "\u53EA\u986F\u793A\u958B\u8457\u6216\u7570\u5E38\u7684", "zh-Hans": "\u53EA\u663E\u793A\u5F00\u7740\u6216\u5F02\u5E38\u7684" }, help: { en: "Leaves out what is off or closed. Numbers always stay.", es: "Deja fuera lo apagado o cerrado. Los n\xFAmeros se quedan siempre.", de: "L\xE4sst weg, was aus oder geschlossen ist. Zahlen bleiben immer.", "zh-Hant": "\u7565\u904E\u5DF2\u95DC\u9589\u6216\u95DC\u4E0A\u7684\u9805\u76EE\u3002\u6578\u503C\u4E00\u5F8B\u4FDD\u7559\u3002", "zh-Hans": "\u7565\u8FC7\u5DF2\u5173\u95ED\u6216\u5173\u4E0A\u7684\u9879\u76EE\u3002\u6570\u503C\u59CB\u7EC8\u4FDD\u7559\u3002" } }),
|
|
2597
|
+
hideUnavailable: t5.boolean({ label: { en: "Hide unavailable entities", es: "Ocultar las entidades no disponibles", de: "Nicht verf\xFCgbare Entit\xE4ten ausblenden", "zh-Hant": "\u96B1\u85CF\u7121\u6CD5\u4F7F\u7528\u7684\u5BE6\u9AD4", "zh-Hans": "\u9690\u85CF\u4E0D\u53EF\u7528\u7684\u5B9E\u4F53" } }),
|
|
2598
|
+
decimals: t5.integer({ default: -1, min: -1, max: 4, advanced: true, label: { en: "Decimals", es: "Decimales", de: "Nachkommastellen", "zh-Hant": "\u5C0F\u6578\u4F4D\u6578", "zh-Hans": "\u5C0F\u6570\u4F4D\u6570" }, help: { en: "-1 = automatic.", es: "-1 = autom\xE1tico.", de: "-1 = automatisch.", "zh-Hant": "-1 = \u81EA\u52D5\u3002", "zh-Hans": "-1 = \u81EA\u52A8\u3002" } }),
|
|
2538
2599
|
...batteryFields()
|
|
2539
2600
|
}),
|
|
2540
2601
|
redraw: "minute",
|
|
@@ -2548,7 +2609,7 @@ var entities = defineWidget5({
|
|
|
2548
2609
|
const box = frame(g, ctx.box, ctx, data);
|
|
2549
2610
|
if (!box || !data) return;
|
|
2550
2611
|
const list = listed(data, options);
|
|
2551
|
-
if (!list.length) return drawEmpty(g, { ...ctx, box }, tr({ en: "No entities match", es: "Ninguna entidad coincide" }));
|
|
2612
|
+
if (!list.length) return drawEmpty(g, { ...ctx, box }, tr({ en: "No entities match", es: "Ninguna entidad coincide", de: "Keine passenden Entit\xE4ten", "zh-Hant": "\u6C92\u6709\u7B26\u5408\u7684\u5BE6\u9AD4", "zh-Hans": "\u6CA1\u6709\u5339\u914D\u7684\u5B9E\u4F53" }));
|
|
2552
2613
|
const plan = listLayout(box, list.length, options, {
|
|
2553
2614
|
sizes: { "one-line": { min: 22, max: Math.max(22, Math.min(40, box.w / 11)) }, detailed: { min: 42, max: Math.max(42, Math.min(66, box.w / 6)) } },
|
|
2554
2615
|
auto: (b, n) => b.h / Math.max(1, n) >= 52 && b.h >= b.w * 0.6 ? "detailed" : "one-line",
|
|
@@ -2585,10 +2646,13 @@ function listed(data, o) {
|
|
|
2585
2646
|
}
|
|
2586
2647
|
var attention = defineWidget5({
|
|
2587
2648
|
id: "attention",
|
|
2588
|
-
name: { en: "Home: needs you", es: "Casa: te necesita" },
|
|
2649
|
+
name: { en: "Home: needs you", es: "Casa: te necesita", de: "Zuhause: braucht dich", "zh-Hant": "\u5C45\u5BB6\uFF1A\u9700\u8981\u4F60\u8655\u7406", "zh-Hans": "\u5BB6\u91CC\uFF1A\u9700\u8981\u4F60\u5904\u7406" },
|
|
2589
2650
|
description: {
|
|
2590
2651
|
en: "Only what needs you at home: smoke, a leak or the alarm in red (and it keeps its tile until they stop), then doors and windows left open, unlocked locks, low batteries and problems. Hides itself when all is well.",
|
|
2591
|
-
es: "Solo lo que te necesita en casa: humo, una fuga o la alarma en rojo (y se queda con su tesela hasta que paren), luego puertas y ventanas abiertas, cerraduras sin cerrar, bater\xEDas bajas y problemas. Se oculta cuando todo va bien."
|
|
2652
|
+
es: "Solo lo que te necesita en casa: humo, una fuga o la alarma en rojo (y se queda con su tesela hasta que paren), luego puertas y ventanas abiertas, cerraduras sin cerrar, bater\xEDas bajas y problemas. Se oculta cuando todo va bien.",
|
|
2653
|
+
de: "Nur, was zu Hause deine Aufmerksamkeit braucht: Rauch, ein Leck oder die Alarmanlage in Rot (dann beh\xE4lt es seine Kachel, bis es aufh\xF6rt), danach offene T\xFCren und Fenster, entriegelte Schl\xF6sser, schwache Batterien und Probleme. Blendet sich aus, wenn alles in Ordnung ist.",
|
|
2654
|
+
"zh-Hant": "\u53EA\u986F\u793A\u5BB6\u4E2D\u9700\u8981\u4F60\u8655\u7406\u7684\u4E8B\uFF1A\u7159\u9727\u3001\u6F0F\u6C34\u6216\u8B66\u5831\u89F8\u767C\uFF08\u7D05\u8272\uFF0C\u4E14\u6703\u4E00\u76F4\u4FDD\u6709\u5176\u65B9\u683C\u76F4\u5230\u89E3\u9664\uFF09\uFF0C\u63A5\u8457\u662F\u6C92\u95DC\u7684\u9580\u7A97\u3001\u672A\u4E0A\u9396\u7684\u9396\u3001\u96FB\u91CF\u4F4E\u7684\u96FB\u6C60\u548C\u7570\u5E38\u3002\u4E00\u5207\u6B63\u5E38\u6642\u6703\u81EA\u52D5\u96B1\u85CF\u3002",
|
|
2655
|
+
"zh-Hans": "\u53EA\u663E\u793A\u5BB6\u91CC\u9700\u8981\u4F60\u5904\u7406\u7684\u4E8B\uFF1A\u70DF\u96FE\u3001\u6F0F\u6C34\u6216\u8B66\u62A5\u89E6\u53D1\uFF08\u7EA2\u8272\uFF0C\u5E76\u4F1A\u4E00\u76F4\u5360\u7528\u5176\u683C\u5B50\u76F4\u5230\u89E3\u9664\uFF09\uFF0C\u7136\u540E\u662F\u6CA1\u5173\u7684\u95E8\u7A97\u3001\u672A\u4E0A\u9501\u7684\u9501\u3001\u7535\u91CF\u4F4E\u7684\u7535\u6C60\u548C\u5F02\u5E38\u3002\u4E00\u5207\u6B63\u5E38\u65F6\u4F1A\u81EA\u52A8\u9690\u85CF\u3002"
|
|
2592
2656
|
},
|
|
2593
2657
|
icon: "shield-alert",
|
|
2594
2658
|
category: "info",
|
|
@@ -2597,13 +2661,13 @@ var attention = defineWidget5({
|
|
|
2597
2661
|
sources: [SOURCE5],
|
|
2598
2662
|
options: t5.object({
|
|
2599
2663
|
...listOptions({ layouts: ["one-line", "detailed"] }),
|
|
2600
|
-
entities: t5.filter({ choices: { source: SOURCE5, list: "entities" }, label: { en: "Entities", es: "Entidades" }, help: { en: "Empty = all. Leave out the ones that are fine open with !: !binary_sensor.patio_door.", es: "Vac\xEDo = todas. Deja fuera con ! las que pueden estar abiertas: !binary_sensor.patio_door." } }),
|
|
2601
|
-
includeOpenings: t5.boolean({ default: true, label: { en: "Doors, windows and locks", es: "Puertas, ventanas y cerraduras" }, help: { en: "Open doors, windows, garage doors and gates; unlocked locks.", es: "Puertas, ventanas, garajes y cancelas abiertas; cerraduras sin cerrar." } }),
|
|
2602
|
-
openMs: t5.duration({ default: 0, label: { en: "Open for at least", es: "Abierta al menos" }, help: { en: "A door counts once it has been open this long. 0 = at once.", es: "Una puerta cuenta cuando lleva abierta este tiempo. 0 = al momento." } }),
|
|
2603
|
-
includeBatteries: t5.boolean({ default: true, label: { en: "Low batteries", es: "Bater\xEDas bajas" } }),
|
|
2604
|
-
includeProblems: t5.boolean({ default: true, label: { en: "Problems", es: "Problemas" }, help: { en: "Problem and tamper sensors, lost connections, a vacuum in error.", es: "Sensores de problema y manipulaci\xF3n, conexiones perdidas, un robot aspirador en error." } }),
|
|
2605
|
-
includeUnavailable: t5.boolean({ label: { en: "Unavailable devices", es: "Dispositivos no disponibles" } }),
|
|
2606
|
-
includeUpdates: t5.boolean({ label: { en: "Updates available", es: "Actualizaciones disponibles" } }),
|
|
2664
|
+
entities: t5.filter({ choices: { source: SOURCE5, list: "entities" }, label: { en: "Entities", es: "Entidades", de: "Entit\xE4ten", "zh-Hant": "\u5BE6\u9AD4", "zh-Hans": "\u5B9E\u4F53" }, help: { en: "Empty = all. Leave out the ones that are fine open with !: !binary_sensor.patio_door.", es: "Vac\xEDo = todas. Deja fuera con ! las que pueden estar abiertas: !binary_sensor.patio_door.", de: "Leer = alle. Mit ! weglassen, was offen sein darf: !binary_sensor.patio_door.", "zh-Hant": "\u7559\u7A7A = \u5168\u90E8\u3002\u53EF\u4EE5\u958B\u8457\u7684\uFF0C\u7528 ! \u6392\u9664\uFF1A!binary_sensor.patio_door\u3002", "zh-Hans": "\u7559\u7A7A = \u5168\u90E8\u3002\u53EF\u4EE5\u5F00\u7740\u7684\uFF0C\u7528 ! \u6392\u9664\uFF1A!binary_sensor.patio_door\u3002" } }),
|
|
2665
|
+
includeOpenings: t5.boolean({ default: true, label: { en: "Doors, windows and locks", es: "Puertas, ventanas y cerraduras", de: "T\xFCren, Fenster und Schl\xF6sser", "zh-Hant": "\u9580\u3001\u7A97\u548C\u9396", "zh-Hans": "\u95E8\u3001\u7A97\u548C\u9501" }, help: { en: "Open doors, windows, garage doors and gates; unlocked locks.", es: "Puertas, ventanas, garajes y cancelas abiertas; cerraduras sin cerrar.", de: "Offene T\xFCren, Fenster, Garagentore und Tore; entriegelte Schl\xF6sser.", "zh-Hant": "\u958B\u8457\u7684\u9580\u3001\u7A97\u3001\u8ECA\u5EAB\u9580\u548C\u5927\u9580\uFF1B\u672A\u4E0A\u9396\u7684\u9396\u3002", "zh-Hans": "\u5F00\u7740\u7684\u95E8\u3001\u7A97\u3001\u8F66\u5E93\u95E8\u548C\u5927\u95E8\uFF1B\u672A\u4E0A\u9501\u7684\u9501\u3002" } }),
|
|
2666
|
+
openMs: t5.duration({ default: 0, label: { en: "Open for at least", es: "Abierta al menos", de: "Offen seit mindestens", "zh-Hant": "\u5DF2\u958B\u555F\u81F3\u5C11", "zh-Hans": "\u5DF2\u6253\u5F00\u81F3\u5C11" }, help: { en: "A door counts once it has been open this long. 0 = at once.", es: "Una puerta cuenta cuando lleva abierta este tiempo. 0 = al momento.", de: "Eine T\xFCr z\xE4hlt, sobald sie so lange offen ist. 0 = sofort.", "zh-Hant": "\u9580\u958B\u8457\u9019\u9EBC\u4E45\u4E4B\u5F8C\u624D\u7B97\u6578\u30020 = \u7ACB\u5373\u3002", "zh-Hans": "\u95E8\u5F00\u7740\u8FD9\u4E48\u4E45\u4E4B\u540E\u624D\u7B97\u30020 = \u7ACB\u5373\u3002" } }),
|
|
2667
|
+
includeBatteries: t5.boolean({ default: true, label: { en: "Low batteries", es: "Bater\xEDas bajas", de: "Schwache Batterien", "zh-Hant": "\u96FB\u91CF\u4F4E\u7684\u96FB\u6C60", "zh-Hans": "\u7535\u91CF\u4F4E\u7684\u7535\u6C60" } }),
|
|
2668
|
+
includeProblems: t5.boolean({ default: true, label: { en: "Problems", es: "Problemas", de: "Probleme", "zh-Hant": "\u7570\u5E38", "zh-Hans": "\u5F02\u5E38" }, help: { en: "Problem and tamper sensors, lost connections, a vacuum in error.", es: "Sensores de problema y manipulaci\xF3n, conexiones perdidas, un robot aspirador en error.", de: "Problem- und Manipulationssensoren, verlorene Verbindungen, ein Saugroboter mit Fehler.", "zh-Hant": "\u7570\u5E38\u8207\u9632\u62C6\u611F\u6E2C\u5668\u3001\u9023\u7DDA\u4E2D\u65B7\u3001\u51FA\u932F\u7684\u6383\u5730\u6A5F\u5668\u4EBA\u3002", "zh-Hans": "\u5F02\u5E38\u548C\u9632\u62C6\u4F20\u611F\u5668\u3001\u8FDE\u63A5\u4E2D\u65AD\u3001\u51FA\u9519\u7684\u626B\u5730\u673A\u5668\u4EBA\u3002" } }),
|
|
2669
|
+
includeUnavailable: t5.boolean({ label: { en: "Unavailable devices", es: "Dispositivos no disponibles", de: "Nicht verf\xFCgbare Ger\xE4te", "zh-Hant": "\u7121\u6CD5\u4F7F\u7528\u7684\u88DD\u7F6E", "zh-Hans": "\u4E0D\u53EF\u7528\u7684\u8BBE\u5907" } }),
|
|
2670
|
+
includeUpdates: t5.boolean({ label: { en: "Updates available", es: "Actualizaciones disponibles", de: "Verf\xFCgbare Updates", "zh-Hant": "\u6709\u53EF\u7528\u66F4\u65B0", "zh-Hans": "\u6709\u53EF\u7528\u66F4\u65B0" } }),
|
|
2607
2671
|
...batteryFields()
|
|
2608
2672
|
}),
|
|
2609
2673
|
hideWhenEmpty: true,
|
|
@@ -2626,7 +2690,7 @@ var attention = defineWidget5({
|
|
|
2626
2690
|
const box = frame(g, ctx.box, ctx, data);
|
|
2627
2691
|
if (!box || !data) return;
|
|
2628
2692
|
const list = notices(data.entities, options, now);
|
|
2629
|
-
if (!list.length) return drawEmpty(g, { ...ctx, box }, tr({ en: "All well at home", es: "Todo en orden en casa" }));
|
|
2693
|
+
if (!list.length) return drawEmpty(g, { ...ctx, box }, tr({ en: "All well at home", es: "Todo en orden en casa", de: "Zuhause alles in Ordnung", "zh-Hant": "\u5BB6\u4E2D\u4E00\u5207\u6B63\u5E38", "zh-Hans": "\u5BB6\u91CC\u4E00\u5207\u6B63\u5E38" }));
|
|
2630
2694
|
const plan = listLayout(box, list.length, options, {
|
|
2631
2695
|
sizes: { "one-line": { min: 24, max: Math.max(24, Math.min(40, box.w / 11)) }, detailed: { min: 44, max: Math.max(44, Math.min(64, box.w / 6)) } },
|
|
2632
2696
|
auto: (b, n) => b.h / Math.max(1, n) >= 50 ? "detailed" : "one-line",
|
|
@@ -2653,13 +2717,17 @@ var attention = defineWidget5({
|
|
|
2653
2717
|
});
|
|
2654
2718
|
var index_default = definePlugin({
|
|
2655
2719
|
id: "homeassistant",
|
|
2656
|
-
name: { en: "Home Assistant", es: "Home Assistant" },
|
|
2657
|
-
version: "0.2.
|
|
2720
|
+
name: { en: "Home Assistant", es: "Home Assistant", de: "Home Assistant", "zh-Hant": "Home Assistant", "zh-Hans": "Home Assistant" },
|
|
2721
|
+
version: "0.2.5",
|
|
2722
|
+
languages: ["en", "es", "de", "zh-Hant", "zh-Hans"],
|
|
2658
2723
|
sdk: "^0.2.0",
|
|
2659
2724
|
permissions: { network: ["user"] },
|
|
2660
2725
|
description: {
|
|
2661
2726
|
en: "Home Assistant on the panel, live over its WebSocket API: any entity in big with its history, lists of entities, what needs you at home (doors left open, low batteries, leaks, the alarm), your cameras (with the doorbell), the energy flow, what's playing and who is home.",
|
|
2662
|
-
es: "Home Assistant en el panel, en directo por su API WebSocket: cualquier entidad en grande con su hist\xF3rico, listas de entidades, lo que te necesita en casa (puertas abiertas, bater\xEDas bajas, fugas, la alarma), tus c\xE1maras (con el timbre), el flujo de energ\xEDa, lo que suena y qui\xE9n est\xE1 en casa."
|
|
2727
|
+
es: "Home Assistant en el panel, en directo por su API WebSocket: cualquier entidad en grande con su hist\xF3rico, listas de entidades, lo que te necesita en casa (puertas abiertas, bater\xEDas bajas, fugas, la alarma), tus c\xE1maras (con el timbre), el flujo de energ\xEDa, lo que suena y qui\xE9n est\xE1 en casa.",
|
|
2728
|
+
de: "Home Assistant auf dem Panel, live \xFCber die WebSocket-API: jede Entit\xE4t in gro\xDF mit Verlauf, Listen von Entit\xE4ten, was zu Hause deine Aufmerksamkeit braucht (offene T\xFCren, schwache Batterien, Lecks, die Alarmanlage), deine Kameras (mit T\xFCrklingel), der Energiefluss, was gerade l\xE4uft und wer zu Hause ist.",
|
|
2729
|
+
"zh-Hant": "\u5728\u9762\u677F\u4E0A\u986F\u793A Home Assistant\uFF0C\u900F\u904E\u5176 WebSocket API \u5373\u6642\u66F4\u65B0\uFF1A\u4EE5\u5927\u5B57\u986F\u793A\u4EFB\u4E00\u5BE6\u9AD4\u53CA\u5176\u6B77\u53F2\u3001\u5BE6\u9AD4\u6E05\u55AE\u3001\u5BB6\u4E2D\u9700\u8981\u4F60\u8655\u7406\u7684\u4E8B\uFF08\u6C92\u95DC\u7684\u9580\u3001\u96FB\u91CF\u4F4E\u7684\u96FB\u6C60\u3001\u6F0F\u6C34\u3001\u8B66\u5831\uFF09\u3001\u4F60\u7684\u651D\u5F71\u6A5F\uFF08\u542B\u9580\u9234\uFF09\u3001\u80FD\u6E90\u6D41\u5411\u3001\u6B63\u5728\u64AD\u653E\u7684\u5167\u5BB9\uFF0C\u4EE5\u53CA\u8AB0\u5728\u5BB6\u3002",
|
|
2730
|
+
"zh-Hans": "\u5728\u526F\u5C4F\u4E0A\u663E\u793A Home Assistant\uFF0C\u901A\u8FC7\u5176 WebSocket API \u5B9E\u65F6\u66F4\u65B0\uFF1A\u4EE5\u5927\u5B57\u663E\u793A\u4EFB\u4E00\u5B9E\u4F53\u53CA\u5176\u5386\u53F2\u3001\u5B9E\u4F53\u5217\u8868\u3001\u5BB6\u91CC\u9700\u8981\u4F60\u5904\u7406\u7684\u4E8B\uFF08\u6CA1\u5173\u7684\u95E8\u3001\u7535\u91CF\u4F4E\u7684\u7535\u6C60\u3001\u6F0F\u6C34\u3001\u8B66\u62A5\uFF09\u3001\u4F60\u7684\u6444\u50CF\u5934\uFF08\u542B\u95E8\u94C3\uFF09\u3001\u80FD\u6E90\u6D41\u5411\u3001\u6B63\u5728\u64AD\u653E\u7684\u5185\u5BB9\uFF0C\u4EE5\u53CA\u8C01\u5728\u5BB6\u3002"
|
|
2663
2731
|
},
|
|
2664
2732
|
icon: "house",
|
|
2665
2733
|
widgets: [entity, entities, attention, camera, energy, media, people],
|
|
@@ -2703,10 +2771,13 @@ export {
|
|
|
2703
2771
|
energyToday,
|
|
2704
2772
|
entities,
|
|
2705
2773
|
entity,
|
|
2774
|
+
errorHint,
|
|
2706
2775
|
flows,
|
|
2707
2776
|
formatEnergy,
|
|
2708
2777
|
formatNumber,
|
|
2709
2778
|
formatPower,
|
|
2779
|
+
historyHas,
|
|
2780
|
+
historyValues,
|
|
2710
2781
|
homeToday,
|
|
2711
2782
|
httpBase,
|
|
2712
2783
|
iconFor,
|