iobroker.hass 2.0.4 → 2.1.2
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/README.md +82 -56
- package/admin/hass.png +0 -0
- package/admin/hass.svg +4 -0
- package/admin/i18n/de.json +8 -2
- package/admin/i18n/en.json +8 -2
- package/admin/i18n/es.json +8 -2
- package/admin/i18n/fr.json +11 -5
- package/admin/i18n/it.json +8 -2
- package/admin/i18n/nl.json +8 -2
- package/admin/i18n/pl.json +8 -2
- package/admin/i18n/pt.json +8 -2
- package/admin/i18n/ru.json +8 -2
- package/admin/i18n/uk.json +8 -2
- package/admin/i18n/zh-cn.json +8 -2
- package/admin/jsonConfig.json +22 -0
- package/build/lib/entityFilter.js +80 -0
- package/build/lib/entityFilter.js.map +1 -0
- package/build/lib/hass.js +4 -3
- package/build/lib/hass.js.map +1 -1
- package/build/main.js +329 -75
- package/build/main.js.map +1 -1
- package/io-package.json +52 -46
- package/package.json +19 -11
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
# ioBroker.hass
|
|
3
3
|
|
|
4
4
|

|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://weblate.iobroker.net/engage/adapters/?utm_source=widget)
|
|
10
10
|
[](https://www.npmjs.com/package/iobroker.hass)
|
|
11
11
|
|
|
12
|
-
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
|
|
12
|
+
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information on how to disable the error reporting, see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
This adapter allows the connecting of Home Assistant to ioBroker.
|
|
@@ -20,7 +20,7 @@ Create a long-term token in HASS and use it as PW (copy it also in the repeat fi
|
|
|
20
20
|
Then it should read out all attributes for all devices. Services might be controllable (e.g. "turn_on"). To control services, you have two options:
|
|
21
21
|
|
|
22
22
|
### Set a direct value
|
|
23
|
-
Set the state with an ack=false value which is not a string (e.g. Boolean true) then it will be triggered also in HASS without additional service data. This will only work if the service has one field to be sent - then the value is sent as this field! If the service has more than one field, you will find a warning in the log that provides more details about the fields that are possible to be sent, e.g.
|
|
23
|
+
Set the state with an ack=false value which is not a string (e.g. Boolean true), then it will be triggered also in HASS without additional service data. This will only work if the service has one field to be sent - then the value is sent as this field! If the service has more than one field, you will find a warning in the log that provides more details about the fields that are possible to be sent, e.g.
|
|
24
24
|
|
|
25
25
|
```
|
|
26
26
|
Please make sure to provide a stringified JSON as value to set relevant fields! Please refer to the Readme for details!
|
|
@@ -94,18 +94,94 @@ For some services like set_speed it is required to call with a JSON object like
|
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
## Configuration
|
|
97
|
-
There is a good article about connection.
|
|
97
|
+
There is a good article about the connection.
|
|
98
98
|
|
|
99
99
|
Please check it https://www.smarthomejetzt.de/mit-iobroker-auf-eine-home-assistant-hass-io-installation-und-die-geraete-zugreifen/
|
|
100
100
|
|
|
101
101
|
**Unfortunately only in German, but the [Google Translate works rather good](https://translate.google.com/translate?hl=en&sl=de&tl=en&u=https%3A%2F%2Fwww.smarthomejetzt.de%2Fmit-iobroker-auf-eine-home-assistant-hass-io-installation-und-die-geraete-zugreifen%2F)**
|
|
102
102
|
|
|
103
|
+
## Entity exclude filter
|
|
104
|
+
|
|
105
|
+
Optionally, restrict which Home Assistant entities are synchronised into ioBroker.
|
|
106
|
+
|
|
107
|
+
Each non-empty, non-comment line in the **Exclude patterns** field is a glob
|
|
108
|
+
(only `*` is a wildcard and matches any sequence of characters, including `.`).
|
|
109
|
+
Matching is case-sensitive and anchored to the full id. There are two kinds of patterns:
|
|
110
|
+
|
|
111
|
+
- **Entity patterns** (all patterns not starting with `entities.`) are matched
|
|
112
|
+
against the full `entity_id` (e.g. `switch.living_room`) only.
|
|
113
|
+
- **Object path patterns** start with `entities.` and are matched against the
|
|
114
|
+
ioBroker object id without the instance prefix (e.g.
|
|
115
|
+
`entities.sensor.living_room_temperature.device_class`). The instance prefix
|
|
116
|
+
may be included (e.g. `hass.0.entities.…`), so ids copied from the object
|
|
117
|
+
browser work as well.
|
|
118
|
+
|
|
119
|
+
An entity that matches an entity pattern, or whose channel `entities.<entity_id>`
|
|
120
|
+
matches an object path pattern, is:
|
|
121
|
+
|
|
122
|
+
- skipped when objects are created or updated (initial sync and re-syncs)
|
|
123
|
+
- ignored when its state changes in HASS (no state writes triggered in ioBroker)
|
|
124
|
+
|
|
125
|
+
A single state, attribute or service object that matches an object path pattern
|
|
126
|
+
is skipped individually. This can be used to drop noisy attributes such as
|
|
127
|
+
`device_class` or `state_class` without dropping the sensor itself. Entity
|
|
128
|
+
patterns never match object paths: `*battery*` drops battery entities, but not
|
|
129
|
+
the `battery_level` attribute of other entities.
|
|
130
|
+
|
|
131
|
+
Lines starting with `#` are treated as comments.
|
|
132
|
+
|
|
133
|
+
Examples:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
# Drop every entity whose name starts with `iob_`, regardless of domain:
|
|
137
|
+
*.iob_*
|
|
138
|
+
|
|
139
|
+
# Drop sensors only:
|
|
140
|
+
sensor.iob_*
|
|
141
|
+
|
|
142
|
+
# Drop a whole ioBroker object subtree:
|
|
143
|
+
entities.device_tracker.*
|
|
144
|
+
|
|
145
|
+
# Drop noisy attributes from all synced entities while keeping the main state:
|
|
146
|
+
entities.*.*.device_class
|
|
147
|
+
entities.*.*.state_class
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Tick **Verbose filter logging** to log every excluded `entity_id` individually
|
|
151
|
+
during the first sync (requires adapter loglevel `info` or `debug`). Subsequent
|
|
152
|
+
re-syncs only emit the aggregate count to keep the log clean.
|
|
153
|
+
|
|
154
|
+
An empty pattern list leaves the adapter behaviour identical to previous versions.
|
|
155
|
+
|
|
156
|
+
## Large installations
|
|
157
|
+
|
|
158
|
+
js-controller warns when an adapter instance has more objects than its object
|
|
159
|
+
warning limit (5000 by default). A Home Assistant installation can easily exceed
|
|
160
|
+
this, so the adapter declares a default limit of 30000 (js-controller >= 7.1.2).
|
|
161
|
+
If the warning still appears for an existing instance, raise the value of
|
|
162
|
+
`system.adapter.hass.<instance>.objectsWarnLimit` or reduce the number of objects
|
|
163
|
+
with object path patterns (see above).
|
|
164
|
+
|
|
103
165
|
<!--
|
|
104
166
|
Placeholder for the next version (at the beginning of the line):
|
|
105
167
|
### **WORK IN PROGRESS**
|
|
106
168
|
-->
|
|
107
169
|
|
|
108
170
|
## Changelog
|
|
171
|
+
### 2.1.2 (2026-10-13)
|
|
172
|
+
- (@GermanBluefox) Fixed the build: 2.1.1 was not published to npm
|
|
173
|
+
|
|
174
|
+
### 2.1.1 (2026-09-14)
|
|
175
|
+
- (copilot) Adapter requires node.js >= 22 now
|
|
176
|
+
- (@rockbaer2007) Exclude patterns starting with `entities.` filter single objects (e.g. `entities.*.*.device_class`) without dropping the entity
|
|
177
|
+
- (@rockbaer2007) Reduced resync noise and raised the default object warning limit to 30000 for large installations
|
|
178
|
+
- (@GermanBluefox) State changes received during the initial synchronization are applied afterward instead of being lost
|
|
179
|
+
|
|
180
|
+
### 2.1.0 (2026-05-16)
|
|
181
|
+
* (mokusone) Added optional entity exclude filter with glob patterns, configurable via the admin UI, plus a verbose-logging toggle for inspecting matches
|
|
182
|
+
* (@klein0r) Use `/core/` instead of `/api/` when connecting to supervisor directly (e.g., in ha app)
|
|
183
|
+
* (@klein0r) Use ENV var SUPERVISOR_TOKEN as fallback for password
|
|
184
|
+
|
|
109
185
|
### 2.0.4 (2026-05-05)
|
|
110
186
|
* (@GermanBluefox) Tried to keep the custom settings of the objects when updating them with new data from HASS
|
|
111
187
|
|
|
@@ -113,60 +189,10 @@ Please check it https://www.smarthomejetzt.de/mit-iobroker-auf-eine-home-assista
|
|
|
113
189
|
* (@GermanBluefox) Adapter was updated and migrated to TypeScript
|
|
114
190
|
* (@Titanium177) Added roles for states and added debouncing for reading states from hass
|
|
115
191
|
|
|
116
|
-
### 1.4.0 (2023-01-03)
|
|
117
|
-
* (Apollon77) Added more guidance logging when setting services incorrectly
|
|
118
|
-
* (Apollon77) Prevent crashes when attributes contain "." at the end of their names
|
|
119
|
-
* (Apollon77) Added logging for state updates for unknown objects
|
|
120
|
-
|
|
121
|
-
### 1.3.0 (2022-07-01)
|
|
122
|
-
* (Apollon77) Further optimize sending data to HASS and allow setting values like numbers as normal states if the service has one attribute and it can be mapped
|
|
123
|
-
|
|
124
|
-
### 1.2.0 (2022-06-17)
|
|
125
|
-
* (Apollon77) IMPORTANT: Replace special characters in entity attribute names with an underscore! Object IDs might change!
|
|
126
|
-
* (Apollon77) make sure a "null" value in state changes is not crashing
|
|
127
|
-
|
|
128
|
-
### 1.1.2 (2022-03-29)
|
|
129
|
-
* (Apollon77) Fix crash cases reported by Sentry
|
|
130
|
-
|
|
131
|
-
### 1.1.1 (2022-03-25)
|
|
132
|
-
* (Apollon77) Show password fields masked again in config
|
|
133
|
-
|
|
134
|
-
### 1.1.0 (2022-03-24)
|
|
135
|
-
* IMPORTANT: You need to re-enter the password once after installing this version!
|
|
136
|
-
* (Apollon77) Implement Service triggers to use any value to trigger or stringified JSON to call with fields
|
|
137
|
-
* (Apollon77) Optimize unload handling
|
|
138
|
-
* (Apollon7) Add Sentry for crash reporting
|
|
139
|
-
|
|
140
|
-
### 1.0.1 (2021-09-04)
|
|
141
|
-
* IMPORTANT: js-controller 2.0 is needed at least!
|
|
142
|
-
* (Apollon77) Fix start issue
|
|
143
|
-
* (Apollon77/Garfonso) Fix issue where value could not be set in hass
|
|
144
|
-
|
|
145
|
-
### 1.0.0 (2020-12-13)
|
|
146
|
-
* (bluefox) added the support of compact mode
|
|
147
|
-
|
|
148
|
-
### 0.1.0
|
|
149
|
-
* (bluefox) initial release
|
|
150
|
-
|
|
151
192
|
## License
|
|
193
|
+
|
|
152
194
|
The MIT License (MIT)
|
|
153
195
|
|
|
154
196
|
Copyright (c) 2018-2026 bluefox <dogafox@gmail.com>
|
|
155
197
|
|
|
156
|
-
|
|
157
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
158
|
-
in the Software without restriction, including without limitation the rights
|
|
159
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
160
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
161
|
-
furnished to do so, subject to the following conditions:
|
|
162
|
-
|
|
163
|
-
The above copyright notice and this permission notice shall be included in
|
|
164
|
-
all copies or substantial portions of the Software.
|
|
165
|
-
|
|
166
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
167
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
168
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
169
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
170
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
171
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
172
|
-
THE SOFTWARE.
|
|
198
|
+
See [LICENSE](LICENSE).
|
package/admin/hass.png
CHANGED
|
Binary file
|
package/admin/hass.svg
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.6 2.3 241.5 241.5">
|
|
2
|
+
<path fill="#18BCF2" d="M240 224.762C240 233.012 233.25 239.762 225 239.762H15C6.75 239.762 0 233.012 0 224.762V134.762C0 126.512 4.77 114.993 10.61 109.153L109.39 10.373C115.22 4.543 124.77 4.543 130.6 10.373L229.39 109.162C235.22 114.992 240 126.522 240 134.772Z"/>
|
|
3
|
+
<path fill="#F2F4F9" d="M107.27 239.762L66.64 199.132C64.55 199.852 62.32 200.262 60 200.262C48.7 200.262 39.5 191.062 39.5 179.762C39.5 168.462 48.7 159.262 60 159.262C71.3 159.262 80.5 168.462 80.5 179.762C80.5 182.092 80.09 184.312 79.37 186.402L111 218.032V102.662C104.2 99.333 99.5 92.373 99.5 84.263C99.5 72.963 108.7 63.763 120 63.763C131.3 63.763 140.5 72.963 140.5 84.263C140.5 92.373 135.8 99.333 129 102.662V183.432L160.46 151.972C159.84 150.012 159.5 147.932 159.5 145.772C159.5 134.472 168.7 125.272 180 125.272C191.3 125.272 200.5 134.472 200.5 145.772C200.5 157.072 191.3 166.272 180 166.272C177.5 166.272 175.12 165.802 172.91 164.982L129 208.892V239.762Z"/>
|
|
4
|
+
</svg>
|
package/admin/i18n/de.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Ausgefilterte Entitäten beim Adapter-Start löschen",
|
|
3
|
+
"Exclude patterns (one per line)": "Filter-Patterns (eines pro Zeile)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Glob-Patterns mit * als Wildcard. Zeilen mit # sind Kommentare. Leer = Filter aus.",
|
|
2
5
|
"Home assistant IP": "IP-Adresse von Home Assistant",
|
|
3
6
|
"Home assistant WS Port": "Home Assistant WebSocket-Port",
|
|
4
|
-
"Password repeat": "Passwort wiederholen",
|
|
5
7
|
"Password": "Passwort",
|
|
8
|
+
"Password repeat": "Passwort wiederholen",
|
|
6
9
|
"Passwords missmatch!": "Passwörter stimmen nicht überein!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Ausführliches Filter-Logging",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Wenn aktiv: jede ausgeschlossene entity_id wird beim initialen Adapter-Sync einzeln geloggt (benötigt Loglevel info oder debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Wenn aktiv: bei jedem Adapter-Start werden vorhandene Objekte unter entities.*, deren entity_id auf die Filter-Patterns matched, gelöscht. Objekte mit Custom-Adapter-Konfiguration (history/influxdb/sql) bleiben erhalten und werden geloggt."
|
|
8
14
|
}
|
package/admin/i18n/en.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Cleanup excluded entities on adapter start",
|
|
3
|
+
"Exclude patterns (one per line)": "Exclude patterns (one per line)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.",
|
|
2
5
|
"Home assistant IP": "Home assistant IP",
|
|
3
6
|
"Home assistant WS Port": "Home assistant WS Port",
|
|
4
|
-
"Password repeat": "Password repeat",
|
|
5
7
|
"Password": "Password",
|
|
8
|
+
"Password repeat": "Password repeat",
|
|
6
9
|
"Passwords missmatch!": "Passwords missmatch!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Verbose filter logging",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged."
|
|
8
14
|
}
|
package/admin/i18n/es.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Limpiar las entidades excluidas al iniciar el adaptador.",
|
|
3
|
+
"Exclude patterns (one per line)": "Patrones de exclusión (uno por línea)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Patrones glob, * como comodín. Las líneas que empiezan con # son comentarios. Vacío = filtro desactivado.",
|
|
2
5
|
"Home assistant IP": "IP del asistente de hogar",
|
|
3
6
|
"Home assistant WS Port": "Asistente doméstico Puerto WS",
|
|
4
|
-
"Password repeat": "Repite la contraseña",
|
|
5
7
|
"Password": "Clave",
|
|
8
|
+
"Password repeat": "Repite la contraseña",
|
|
6
9
|
"Passwords missmatch!": "¡Las contraseñas no coinciden!",
|
|
7
|
-
"Secure": "¿HTTPS?"
|
|
10
|
+
"Secure": "¿HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Registro detallado del filtro",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Cuando está activado, cada entity_id excluido se registra individualmente durante la sincronización inicial del adaptador (requiere loglevel info o debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Cuando está habilitada, en cada inicio del adaptador se eliminan los objetos existentes en entities.* cuyo entity_id coincida con los patrones de exclusión. Los objetos con configuración de adaptador personalizada (history/influxdb/sql) se conservan y se registran."
|
|
8
14
|
}
|
package/admin/i18n/fr.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Nettoyage des entités exclues au démarrage de l'adaptateur",
|
|
3
|
+
"Exclude patterns (one per line)": "Modèles d'exclusion (un par ligne)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Modèles glob, * comme joker. Les lignes commençant par # sont des commentaires. Vide = filtre désactivé.",
|
|
5
|
+
"Home assistant IP": "IP de l'assistant à domicile ",
|
|
6
|
+
"Home assistant WS Port": "Port WS de l'assistant domestique ",
|
|
5
7
|
"Password": "Mot de passe",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
+
"Password repeat": "Répéter le mot de passe ",
|
|
9
|
+
"Passwords missmatch!": "Les mots de passe ne correspondent pas !",
|
|
10
|
+
"Secure": "HTTPS ?",
|
|
11
|
+
"Verbose filter logging": "Journalisation détaillée du filtre",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Lorsqu'activé, chaque entity_id exclu est journalisé individuellement pendant la synchronisation initiale de l'adaptateur (nécessite loglevel info ou debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Lorsqu'elle est activée, cette option supprime, à chaque démarrage de l'adaptateur, les objets existants sous entities.* dont l'entity_id correspond aux critères d'exclusion. Les objets avec une configuration d'adaptateur personnalisée (history/influxdb/sql) sont conservés et consignés."
|
|
8
14
|
}
|
package/admin/i18n/it.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Pulizia delle entità escluse all'avvio dell'adattatore",
|
|
3
|
+
"Exclude patterns (one per line)": "Pattern di esclusione (uno per riga)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Pattern glob, * come wildcard. Le righe che iniziano con # sono commenti. Vuoto = filtro disattivato.",
|
|
2
5
|
"Home assistant IP": "IP assistente domestico",
|
|
3
6
|
"Home assistant WS Port": "Porta WS dell'assistente domestico",
|
|
4
|
-
"Password repeat": "Ripeti password",
|
|
5
7
|
"Password": "Parola d'ordine",
|
|
8
|
+
"Password repeat": "Ripeti password",
|
|
6
9
|
"Passwords missmatch!": "Le password non corrispondono!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Logging dettagliato del filtro",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Se attivato, registra ogni entity_id escluso individualmente durante la sincronizzazione iniziale dell'adattatore (richiede loglevel info o debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Quando abilitata, all'avvio di ogni adattatore vengono eliminati gli oggetti esistenti in entities.* il cui entity_id corrisponde ai modelli di esclusione. Gli oggetti con configurazione personalizzata dell'adattatore (history/influxdb/sql) vengono mantenuti e registrati."
|
|
8
14
|
}
|
package/admin/i18n/nl.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Verwijder uitgesloten entiteiten bij het opstarten van de adapter.",
|
|
3
|
+
"Exclude patterns (one per line)": "Uitsluitpatronen (één per regel)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Glob-patronen, * als wildcard. Regels die beginnen met # zijn commentaar. Leeg = filter uit.",
|
|
2
5
|
"Home assistant IP": "Thuisassistent IP",
|
|
3
6
|
"Home assistant WS Port": "Thuisassistent WS Poort",
|
|
4
|
-
"Password repeat": "Wachtwoord herhalen",
|
|
5
7
|
"Password": "Wachtwoord",
|
|
8
|
+
"Password repeat": "Wachtwoord herhalen",
|
|
6
9
|
"Passwords missmatch!": "Wachtwoorden komen niet overeen!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Uitgebreide filterlogging",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Indien ingeschakeld, wordt elke uitgesloten entity_id afzonderlijk gelogd tijdens de initiële adapter-synchronisatie (vereist loglevel info of debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Indien ingeschakeld, worden bij elke adapterstart bestaande objecten onder entities.* verwijderd waarvan de entity_id overeenkomt met de uitsluitingspatronen. Objecten met een aangepaste adapterconfiguratie (history/influxdb/sql) worden behouden en gelogd."
|
|
8
14
|
}
|
package/admin/i18n/pl.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Wyczyść wykluczone jednostki podczas uruchamiania adaptera",
|
|
3
|
+
"Exclude patterns (one per line)": "Wzorce wykluczeń (jeden na linię)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Wzorce glob, * jako symbol wieloznaczny. Linie zaczynające się od # to komentarze. Puste = filtr wyłączony.",
|
|
2
5
|
"Home assistant IP": "Adres IP asystenta domowego",
|
|
3
6
|
"Home assistant WS Port": "Asystent domowy Port WS",
|
|
4
|
-
"Password repeat": "Powtórz hasło",
|
|
5
7
|
"Password": "Hasło",
|
|
8
|
+
"Password repeat": "Powtórz hasło",
|
|
6
9
|
"Passwords missmatch!": "Niezgodność haseł!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Szczegółowe logowanie filtra",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Gdy włączone, każde wykluczone entity_id jest logowane osobno podczas początkowej synchronizacji adaptera (wymaga poziomu logowania info lub debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Po włączeniu, przy każdym uruchomieniu adaptera usuwane są istniejące obiekty w encji.*, których identyfikator encji pasuje do wzorców wykluczeń. Obiekty z niestandardową konfiguracją adaptera (history/influxdb/sql) są zachowywane i rejestrowane."
|
|
8
14
|
}
|
package/admin/i18n/pt.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Limpeza de entidades excluídas na inicialização do adaptador",
|
|
3
|
+
"Exclude patterns (one per line)": "Padrões de exclusão (um por linha)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Padrões glob, * como wildcard. Linhas começando com # são comentários. Vazio = filtro desligado.",
|
|
2
5
|
"Home assistant IP": "IP do assistente doméstico",
|
|
3
6
|
"Home assistant WS Port": "Assistente doméstico Porta WS",
|
|
4
|
-
"Password repeat": "Repetição de senha",
|
|
5
7
|
"Password": "Senha",
|
|
8
|
+
"Password repeat": "Repetição de senha",
|
|
6
9
|
"Passwords missmatch!": "As senhas não correspondem!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Registro detalhado do filtro",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Quando ativado, cada entity_id excluído é registrado individualmente durante a sincronização inicial do adaptador (requer loglevel info ou debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Quando ativado, a cada inicialização do adaptador, os objetos existentes em entities.* cujo entity_id corresponde aos padrões de exclusão são excluídos. Os objetos com configuração de adaptador personalizada (history/influxdb/sql) são mantidos e registrados."
|
|
8
14
|
}
|
package/admin/i18n/ru.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Удалите исключенные объекты при запуске адаптера.",
|
|
3
|
+
"Exclude patterns (one per line)": "Шаблоны исключения (по одному на строку)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Glob-шаблоны, * — подстановочный знак. Строки, начинающиеся с #, являются комментариями. Пусто = фильтр выключен.",
|
|
2
5
|
"Home assistant IP": "Домашний помощник IP",
|
|
3
6
|
"Home assistant WS Port": "Домашний помощник WS Порт",
|
|
4
|
-
"Password repeat": "Повтор пароля",
|
|
5
7
|
"Password": "Пароль",
|
|
8
|
+
"Password repeat": "Повтор пароля",
|
|
6
9
|
"Passwords missmatch!": "Пароли не совпадают!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Подробное логирование фильтра",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Когда включено, каждый исключённый entity_id логируется отдельно во время начальной синхронизации адаптера (требуется loglevel info или debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "При включении этой функции при каждом запуске адаптера удалять существующие объекты в папке entities.*, чей entity_id соответствует шаблонам исключения. Объекты с пользовательской конфигурацией адаптера (history/influxdb/sql) сохраняются и записываются в журнал."
|
|
8
14
|
}
|
package/admin/i18n/uk.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "Очищення виключених об'єктів під час запуску адаптера",
|
|
3
|
+
"Exclude patterns (one per line)": "Шаблони виключення (по одному в рядку)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Glob-шаблони, * — підстановочний знак. Рядки, що починаються з #, є коментарями. Порожньо = фільтр вимкнено.",
|
|
2
5
|
"Home assistant IP": "Домашній помічник IP",
|
|
3
6
|
"Home assistant WS Port": "Домашній помічник WS Порт",
|
|
4
|
-
"Password repeat": "Повторення пароля",
|
|
5
7
|
"Password": "Пароль",
|
|
8
|
+
"Password repeat": "Повторення пароля",
|
|
6
9
|
"Passwords missmatch!": "Паролі не збігаються!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "Детальне логування фільтра",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Коли увімкнено, кожен виключений entity_id логується окремо під час початкової синхронізації адаптера (потрібен loglevel info або debug).",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "Якщо ввімкнено, на кожному адаптері починається видалення існуючих об'єктів у розділі entity.*, чий entity_id відповідає шаблонам виключення. Об'єкти з власною конфігурацією адаптера (history/influxdb/sql) зберігаються та реєструються."
|
|
8
14
|
}
|
package/admin/i18n/zh-cn.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Cleanup excluded entities on adapter start": "适配器启动时清理排除的实体",
|
|
3
|
+
"Exclude patterns (one per line)": "排除模式(每行一个)",
|
|
4
|
+
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Glob 模式,* 通配符。以 # 开头的行是注释。为空 = 过滤器关闭。",
|
|
2
5
|
"Home assistant IP": "家庭助理IP:",
|
|
3
6
|
"Home assistant WS Port": "家庭助理 WS 端口:",
|
|
4
|
-
"Password repeat": "密码重复:",
|
|
5
7
|
"Password": "密码:",
|
|
8
|
+
"Password repeat": "密码重复:",
|
|
6
9
|
"Passwords missmatch!": "密码不匹配!",
|
|
7
|
-
"Secure": "HTTPS?"
|
|
10
|
+
"Secure": "HTTPS?",
|
|
11
|
+
"Verbose filter logging": "详细过滤器日志",
|
|
12
|
+
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "启用后,在适配器初始同步期间单独记录每个被排除的 entity_id(需要日志级别 info 或 debug)。",
|
|
13
|
+
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "启用此功能后,每次适配器启动时,都会删除 entities.* 下 entity_id 与排除模式匹配的现有对象。具有自定义适配器配置(history/influxdb/sql)的对象将被保留并记录。"
|
|
8
14
|
}
|
package/admin/jsonConfig.json
CHANGED
|
@@ -39,6 +39,28 @@
|
|
|
39
39
|
"sm": 12,
|
|
40
40
|
"md": 6,
|
|
41
41
|
"lg": 4
|
|
42
|
+
},
|
|
43
|
+
"_divider3": {
|
|
44
|
+
"type": "divider"
|
|
45
|
+
},
|
|
46
|
+
"excludePatterns": {
|
|
47
|
+
"type": "text",
|
|
48
|
+
"label": "Exclude patterns (one per line)",
|
|
49
|
+
"help": "Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.",
|
|
50
|
+
"minRows": 6,
|
|
51
|
+
"sm": 12
|
|
52
|
+
},
|
|
53
|
+
"verboseFilterLog": {
|
|
54
|
+
"type": "checkbox",
|
|
55
|
+
"label": "Verbose filter logging",
|
|
56
|
+
"help": "When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).",
|
|
57
|
+
"sm": 12
|
|
58
|
+
},
|
|
59
|
+
"cleanupExcludedOnStart": {
|
|
60
|
+
"type": "checkbox",
|
|
61
|
+
"label": "Cleanup excluded entities on adapter start",
|
|
62
|
+
"help": "When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.",
|
|
63
|
+
"sm": 12
|
|
42
64
|
}
|
|
43
65
|
}
|
|
44
66
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OBJECT_PATH_PREFIX = void 0;
|
|
4
|
+
exports.isExcluded = isExcluded;
|
|
5
|
+
exports.buildExcludeRegexps = buildExcludeRegexps;
|
|
6
|
+
exports.buildExcludeFilter = buildExcludeFilter;
|
|
7
|
+
exports.isEntityIdExcluded = isEntityIdExcluded;
|
|
8
|
+
exports.isObjectPathExcluded = isObjectPathExcluded;
|
|
9
|
+
/** Patterns starting with this prefix address ioBroker object paths instead of HASS entity_ids. */
|
|
10
|
+
exports.OBJECT_PATH_PREFIX = 'entities.';
|
|
11
|
+
/**
|
|
12
|
+
* Returns true if entityId matches any of the supplied glob patterns.
|
|
13
|
+
* Glob syntax: `*` is the only wildcard and matches any sequence of characters
|
|
14
|
+
* (including dots). All other characters are matched literally (regex
|
|
15
|
+
* metacharacters are escaped). Matching is case-sensitive and anchored to
|
|
16
|
+
* the full entity_id.
|
|
17
|
+
*
|
|
18
|
+
* An empty patterns array always returns false.
|
|
19
|
+
*/
|
|
20
|
+
function isExcluded(entityId, patterns) {
|
|
21
|
+
if (!patterns?.length) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
for (const pattern of patterns) {
|
|
25
|
+
if (pattern.test(entityId)) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
function buildExcludeRegexps(patterns) {
|
|
32
|
+
if (!patterns?.length) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
return patterns.map(pattern => {
|
|
36
|
+
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
37
|
+
return new RegExp(`^${escaped}$`);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Splits the configured glob patterns into entity_id patterns and object path patterns.
|
|
42
|
+
* Only patterns starting with `entities.` (optionally with the instance prefix, e.g.
|
|
43
|
+
* `hass.0.entities.`) are matched against object paths. This way entity_id patterns
|
|
44
|
+
* like `*battery*` keep excluding entities only and never drop attributes of other entities.
|
|
45
|
+
*/
|
|
46
|
+
function buildExcludeFilter(patterns, namespace) {
|
|
47
|
+
const entityPatterns = [];
|
|
48
|
+
const objectPatterns = [];
|
|
49
|
+
for (let pattern of patterns || []) {
|
|
50
|
+
if (namespace && pattern.startsWith(`${namespace}.${exports.OBJECT_PATH_PREFIX}`)) {
|
|
51
|
+
pattern = pattern.substring(namespace.length + 1);
|
|
52
|
+
}
|
|
53
|
+
if (pattern.startsWith(exports.OBJECT_PATH_PREFIX)) {
|
|
54
|
+
objectPatterns.push(pattern);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
entityPatterns.push(pattern);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
entityPatterns: buildExcludeRegexps(entityPatterns),
|
|
62
|
+
objectPatterns: buildExcludeRegexps(objectPatterns),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* An entity is excluded if an entity_id pattern matches or an object path pattern
|
|
67
|
+
* matches its channel `entities.<entity_id>` (e.g. `entities.device_tracker.*`).
|
|
68
|
+
*/
|
|
69
|
+
function isEntityIdExcluded(entityId, filter) {
|
|
70
|
+
return (isExcluded(entityId, filter.entityPatterns) ||
|
|
71
|
+
isExcluded(`${exports.OBJECT_PATH_PREFIX}${entityId}`, filter.objectPatterns));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns true if a single object (state, attribute or service) is excluded.
|
|
75
|
+
* The path is the object id without instance prefix, e.g. `entities.sensor.foo.device_class`.
|
|
76
|
+
*/
|
|
77
|
+
function isObjectPathExcluded(path, filter) {
|
|
78
|
+
return isExcluded(path, filter.objectPatterns);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=entityFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityFilter.js","sourceRoot":"","sources":["../../src/lib/entityFilter.ts"],"names":[],"mappings":";;;AAmBA,gCAUC;AAED,kDAQC;AAQD,gDAiBC;AAMD,gDAKC;AAMD,oDAEC;AAnFD,mGAAmG;AACtF,QAAA,kBAAkB,GAAG,WAAW,CAAC;AAS9C;;;;;;;;GAQG;AACH,SAAgB,UAAU,CAAC,QAAgB,EAAE,QAAkB;IAC3D,IAAI,CAAC,QAAQ,EAAE,M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IACD,OAAO;QACH,cAAc,EAAE,mBAAmB,CAAC,cAAc,CAAC;QACnD,cAAc,EAAE,mBAAmB,CAAC,cAAc,CAAC;KACtD,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,QAAgB,EAAE,MAAqB;IACtE,OAAO,CACH,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC;QAC3C,UAAU,CAAC,GAAG,0BAAkB,GAAG,QAAQ,EAAE,EAAE,MAAM,CAAC,cAAc,CAAC,CACxE,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAY,EAAE,MAAqB;IACpE,OAAO,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;AACnD,CAAC"}
|
package/build/lib/hass.js
CHANGED
|
@@ -88,12 +88,13 @@ class HASS extends node_events_1.EventEmitter {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
else if (response.type === 'auth_required') {
|
|
91
|
-
|
|
91
|
+
const password = this.options.password || process.env.SUPERVISOR_TOKEN;
|
|
92
|
+
if (!password) {
|
|
92
93
|
this.emit('error', 'Password required. Connection closed');
|
|
93
94
|
socket.terminate();
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
96
|
-
setTimeout(() => this.sendAuth(socket,
|
|
97
|
+
setTimeout(() => this.sendAuth(socket, password), 50);
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
else if (response.type === 'auth_ok') {
|
|
@@ -196,7 +197,7 @@ class HASS extends node_events_1.EventEmitter {
|
|
|
196
197
|
clearTimeout(this.connectTimeout);
|
|
197
198
|
this.connectTimeout = null;
|
|
198
199
|
}
|
|
199
|
-
this.socket = new ws_1.default(`ws${this.options.secure ? 's' : ''}://${this.options.host}:${this.options.port}
|
|
200
|
+
this.socket = new ws_1.default(`ws${this.options.secure ? 's' : ''}://${this.options.host}:${this.options.port}/${this.options.host === 'supervisor' ? 'core' : 'api'}/websocket`, { perMessageDeflate: false });
|
|
200
201
|
this.initSocket(this.socket);
|
|
201
202
|
}
|
|
202
203
|
close() {
|
package/build/lib/hass.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hass.js","sourceRoot":"","sources":["../../src/lib/hass.ts"],"names":[],"mappings":";;;;;AAAA,6CAA2C;AAC3C,4CAA2B;AAe3B;;;;;;EAME;AACF,MAAqB,IAAK,SAAQ,0BAAY;IAClC,MAAM,GAAqB,IAAI,CAAC;IACvB,OAAO,CAAc;IACrB,GAAG,CAAkB;IAC9B,SAAS,GAAW,CAAC,CAAC;IACb,QAAQ,GAAgC,EAAE,CAAC;IACpD,UAAU,GAAY,KAAK,CAAC;IAC5B,cAAc,GAAyC,IAAI,CAAC;IAC5D,MAAM,GAAY,KAAK,CAAC;IAEhC,YAAY,OAAoB,EAAE,GAAoB;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG;YACX,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,WAAW;YACjC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI;YAChD,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEO,eAAe,CAAC,MAAiB,EAAE,QAAiD;QACxF,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC9C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;YAC/E,MAAM,CAAC,IAAI,C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