mqtt2matter 0.0.0-stage → 0.2.0
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/CHANGELOG.md +76 -0
- package/LICENSE +202 -0
- package/NOTICE +23 -0
- package/README.md +172 -2
- package/dist/app.d.ts +34 -0
- package/dist/app.js +157 -0
- package/dist/app.js.map +1 -0
- package/dist/commands/import-z2m.d.ts +20 -0
- package/dist/commands/import-z2m.js +173 -0
- package/dist/commands/import-z2m.js.map +1 -0
- package/dist/commands/install.d.ts +41 -0
- package/dist/commands/install.js +250 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/update.d.ts +14 -0
- package/dist/commands/update.js +109 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/load.d.ts +57 -0
- package/dist/config/load.js +137 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/schema.d.ts +496 -0
- package/dist/config/schema.js +115 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/engine/payload.d.ts +94 -0
- package/dist/engine/payload.js +515 -0
- package/dist/engine/payload.js.map +1 -0
- package/dist/engine/runtime.d.ts +79 -0
- package/dist/engine/runtime.js +438 -0
- package/dist/engine/runtime.js.map +1 -0
- package/dist/engine/template.d.ts +20 -0
- package/dist/engine/template.js +264 -0
- package/dist/engine/template.js.map +1 -0
- package/dist/engine/units.d.ts +9 -0
- package/dist/engine/units.js +42 -0
- package/dist/engine/units.js.map +1 -0
- package/dist/families/climate.d.ts +11 -0
- package/dist/families/climate.js +68 -0
- package/dist/families/climate.js.map +1 -0
- package/dist/families/color.d.ts +30 -0
- package/dist/families/color.js +152 -0
- package/dist/families/color.js.map +1 -0
- package/dist/families/cover.d.ts +17 -0
- package/dist/families/cover.js +308 -0
- package/dist/families/cover.js.map +1 -0
- package/dist/families/fan.d.ts +16 -0
- package/dist/families/fan.js +154 -0
- package/dist/families/fan.js.map +1 -0
- package/dist/families/index.d.ts +32 -0
- package/dist/families/index.js +162 -0
- package/dist/families/index.js.map +1 -0
- package/dist/families/light.d.ts +36 -0
- package/dist/families/light.js +258 -0
- package/dist/families/light.js.map +1 -0
- package/dist/families/lock.d.ts +10 -0
- package/dist/families/lock.js +31 -0
- package/dist/families/lock.js.map +1 -0
- package/dist/families/on-off.d.ts +7 -0
- package/dist/families/on-off.js +56 -0
- package/dist/families/on-off.js.map +1 -0
- package/dist/families/power-source.d.ts +12 -0
- package/dist/families/power-source.js +60 -0
- package/dist/families/power-source.js.map +1 -0
- package/dist/families/registry.d.ts +40 -0
- package/dist/families/registry.js +72 -0
- package/dist/families/registry.js.map +1 -0
- package/dist/families/rvc.d.ts +40 -0
- package/dist/families/rvc.js +83 -0
- package/dist/families/rvc.js.map +1 -0
- package/dist/families/switch.d.ts +19 -0
- package/dist/families/switch.js +94 -0
- package/dist/families/switch.js.map +1 -0
- package/dist/importers/actions.d.ts +19 -0
- package/dist/importers/actions.js +98 -0
- package/dist/importers/actions.js.map +1 -0
- package/dist/importers/ha/areas.d.ts +6 -0
- package/dist/importers/ha/areas.js +279 -0
- package/dist/importers/ha/areas.js.map +1 -0
- package/dist/importers/ha/generate.d.ts +51 -0
- package/dist/importers/ha/generate.js +1376 -0
- package/dist/importers/ha/generate.js.map +1 -0
- package/dist/importers/ha/index.d.ts +6 -0
- package/dist/importers/ha/index.js +7 -0
- package/dist/importers/ha/index.js.map +1 -0
- package/dist/importers/ha/source.d.ts +36 -0
- package/dist/importers/ha/source.js +95 -0
- package/dist/importers/ha/source.js.map +1 -0
- package/dist/importers/ha/sync.d.ts +29 -0
- package/dist/importers/ha/sync.js +132 -0
- package/dist/importers/ha/sync.js.map +1 -0
- package/dist/importers/ha/templates.d.ts +18 -0
- package/dist/importers/ha/templates.js +285 -0
- package/dist/importers/ha/templates.js.map +1 -0
- package/dist/importers/ha/types.d.ts +78 -0
- package/dist/importers/ha/types.js +479 -0
- package/dist/importers/ha/types.js.map +1 -0
- package/dist/importers/index.d.ts +5 -0
- package/dist/importers/index.js +8 -0
- package/dist/importers/index.js.map +1 -0
- package/dist/importers/patch.d.ts +50 -0
- package/dist/importers/patch.js +224 -0
- package/dist/importers/patch.js.map +1 -0
- package/dist/importers/sync.d.ts +112 -0
- package/dist/importers/sync.js +220 -0
- package/dist/importers/sync.js.map +1 -0
- package/dist/importers/twins.d.ts +10 -0
- package/dist/importers/twins.js +34 -0
- package/dist/importers/twins.js.map +1 -0
- package/dist/importers/z2m/generate.d.ts +81 -0
- package/dist/importers/z2m/generate.js +1171 -0
- package/dist/importers/z2m/generate.js.map +1 -0
- package/dist/importers/z2m/index.d.ts +5 -0
- package/dist/importers/z2m/index.js +6 -0
- package/dist/importers/z2m/index.js.map +1 -0
- package/dist/importers/z2m/source.d.ts +18 -0
- package/dist/importers/z2m/source.js +46 -0
- package/dist/importers/z2m/source.js.map +1 -0
- package/dist/importers/z2m/sync.d.ts +29 -0
- package/dist/importers/z2m/sync.js +92 -0
- package/dist/importers/z2m/sync.js.map +1 -0
- package/dist/importers/z2m/types.d.ts +72 -0
- package/dist/importers/z2m/types.js +46 -0
- package/dist/importers/z2m/types.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/log.d.ts +17 -0
- package/dist/log.js +54 -0
- package/dist/log.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +202 -0
- package/dist/main.js.map +1 -0
- package/dist/matter/bridge.d.ts +113 -0
- package/dist/matter/bridge.js +467 -0
- package/dist/matter/bridge.js.map +1 -0
- package/dist/matter/check.d.ts +11 -0
- package/dist/matter/check.js +116 -0
- package/dist/matter/check.js.map +1 -0
- package/dist/matter/cluster-defaults.d.ts +6 -0
- package/dist/matter/cluster-defaults.js +63 -0
- package/dist/matter/cluster-defaults.js.map +1 -0
- package/dist/matter/commissioning.d.ts +21 -0
- package/dist/matter/commissioning.js +88 -0
- package/dist/matter/commissioning.js.map +1 -0
- package/dist/matter/device-types.d.ts +44 -0
- package/dist/matter/device-types.js +230 -0
- package/dist/matter/device-types.js.map +1 -0
- package/dist/matter/ids.d.ts +31 -0
- package/dist/matter/ids.js +83 -0
- package/dist/matter/ids.js.map +1 -0
- package/dist/matter/index.d.ts +7 -0
- package/dist/matter/index.js +8 -0
- package/dist/matter/index.js.map +1 -0
- package/dist/matter/node-manager.d.ts +39 -0
- package/dist/matter/node-manager.js +161 -0
- package/dist/matter/node-manager.js.map +1 -0
- package/dist/matter/shards.d.ts +26 -0
- package/dist/matter/shards.js +93 -0
- package/dist/matter/shards.js.map +1 -0
- package/dist/model/attribute.d.ts +18 -0
- package/dist/model/attribute.js +28 -0
- package/dist/model/attribute.js.map +1 -0
- package/dist/model/catalog.d.ts +79 -0
- package/dist/model/catalog.js +223 -0
- package/dist/model/catalog.js.map +1 -0
- package/dist/model/index.d.ts +7 -0
- package/dist/model/index.js +8 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/migrate.d.ts +4 -0
- package/dist/model/migrate.js +39 -0
- package/dist/model/migrate.js.map +1 -0
- package/dist/model/options.d.ts +102 -0
- package/dist/model/options.js +88 -0
- package/dist/model/options.js.map +1 -0
- package/dist/model/presets.d.ts +37 -0
- package/dist/model/presets.js +105 -0
- package/dist/model/presets.js.map +1 -0
- package/dist/model/schema.d.ts +1747 -0
- package/dist/model/schema.js +243 -0
- package/dist/model/schema.js.map +1 -0
- package/dist/model/validate.d.ts +21 -0
- package/dist/model/validate.js +484 -0
- package/dist/model/validate.js.map +1 -0
- package/dist/mqtt/client.d.ts +38 -0
- package/dist/mqtt/client.js +94 -0
- package/dist/mqtt/client.js.map +1 -0
- package/dist/mqtt/index.d.ts +2 -0
- package/dist/mqtt/index.js +3 -0
- package/dist/mqtt/index.js.map +1 -0
- package/dist/mqtt/topic-cache.d.ts +20 -0
- package/dist/mqtt/topic-cache.js +58 -0
- package/dist/mqtt/topic-cache.js.map +1 -0
- package/dist/server/auth.d.ts +59 -0
- package/dist/server/auth.js +185 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/catalog.d.ts +52 -0
- package/dist/server/catalog.js +96 -0
- package/dist/server/catalog.js.map +1 -0
- package/dist/server/compact.d.ts +3 -0
- package/dist/server/compact.js +105 -0
- package/dist/server/compact.js.map +1 -0
- package/dist/server/config-store.d.ts +36 -0
- package/dist/server/config-store.js +155 -0
- package/dist/server/config-store.js.map +1 -0
- package/dist/server/events.d.ts +50 -0
- package/dist/server/events.js +71 -0
- package/dist/server/events.js.map +1 -0
- package/dist/server/http.d.ts +27 -0
- package/dist/server/http.js +168 -0
- package/dist/server/http.js.map +1 -0
- package/dist/server/importers.d.ts +40 -0
- package/dist/server/importers.js +75 -0
- package/dist/server/importers.js.map +1 -0
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +8 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/log-buffer.d.ts +22 -0
- package/dist/server/log-buffer.js +55 -0
- package/dist/server/log-buffer.js.map +1 -0
- package/dist/server/presets.d.ts +17 -0
- package/dist/server/presets.js +55 -0
- package/dist/server/presets.js.map +1 -0
- package/dist/server/preview.d.ts +19 -0
- package/dist/server/preview.js +121 -0
- package/dist/server/preview.js.map +1 -0
- package/dist/server/server.d.ts +107 -0
- package/dist/server/server.js +810 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/update.d.ts +60 -0
- package/dist/server/update.js +191 -0
- package/dist/server/update.js.map +1 -0
- package/docs/api.md +128 -0
- package/docs/architecture.md +121 -0
- package/docs/config.md +538 -0
- package/docs/importers.md +241 -0
- package/example/mqtt2matter.json +276 -0
- package/package.json +90 -4
- package/presets/mqtt-smarthome/button.json +47 -0
- package/presets/mqtt-smarthome/contact.json +37 -0
- package/presets/mqtt-smarthome/cover.json +50 -0
- package/presets/mqtt-smarthome/dimmer.json +57 -0
- package/presets/mqtt-smarthome/humidity.json +38 -0
- package/presets/mqtt-smarthome/light.json +47 -0
- package/presets/mqtt-smarthome/occupancy.json +46 -0
- package/presets/mqtt-smarthome/switch.json +47 -0
- package/presets/mqtt-smarthome/temperature.json +38 -0
- package/presets/openbeken/color-light.json +64 -0
- package/presets/openbeken/ct-light.json +51 -0
- package/presets/openbeken/dimmer.json +47 -0
- package/presets/openbeken/humidity.json +37 -0
- package/presets/openbeken/relay.json +40 -0
- package/presets/openbeken/temperature.json +41 -0
- package/presets/shelly-gen1/dimmer.json +48 -0
- package/presets/shelly-gen1/door-window.json +43 -0
- package/presets/shelly-gen1/ht.json +43 -0
- package/presets/shelly-gen1/relay-pm.json +60 -0
- package/presets/shelly-gen1/relay.json +36 -0
- package/presets/shelly-gen1/roller.json +52 -0
- package/presets/shelly-gen2/cover.json +68 -0
- package/presets/shelly-gen2/dimmer.json +61 -0
- package/presets/shelly-gen2/ht.json +47 -0
- package/presets/shelly-gen2/i4.json +82 -0
- package/presets/shelly-gen2/switch-pm.json +101 -0
- package/presets/shelly-gen2/switch.json +47 -0
- package/presets/tasmota/climate.json +52 -0
- package/presets/tasmota/color-light.json +63 -0
- package/presets/tasmota/ct-light.json +50 -0
- package/presets/tasmota/dimmer.json +45 -0
- package/presets/tasmota/relay.json +39 -0
- package/presets/tasmota/shutter.json +46 -0
- package/presets/tasmota/temperature-humidity.json +42 -0
- package/presets/tasmota/temperature.json +32 -0
- package/presets/valetudo/vacuum.json +103 -0
- package/presets/wled/dimmer.json +46 -0
- package/presets/wled/light.json +59 -0
- package/ui/dist/assets/index-BDtT6bdH.js +10 -0
- package/ui/dist/assets/index-CHiG-aoU.css +1 -0
- package/ui/dist/index.html +18 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/* Home Assistant's `suggested_area` onto Matter's Common Area semantic tags (namespace 0x10, the tag
|
|
2
|
+
ids of the Matter namespaces specification as matter.js ships them in `CommonAreaNamespaceTag`;
|
|
3
|
+
test/ha-areas.test.ts checks the ids against the library). A name that matches a tag — in English or
|
|
4
|
+
through the German synonyms below — becomes a Descriptor tag on the device's own endpoint; any other
|
|
5
|
+
name is only carried in the discovery report. */
|
|
6
|
+
const TAGS = {
|
|
7
|
+
Aisle: 0,
|
|
8
|
+
Attic: 1,
|
|
9
|
+
BackDoor: 2,
|
|
10
|
+
BackYard: 3,
|
|
11
|
+
Balcony: 4,
|
|
12
|
+
Ballroom: 5,
|
|
13
|
+
Bathroom: 6,
|
|
14
|
+
Bedroom: 7,
|
|
15
|
+
Border: 8,
|
|
16
|
+
Boxroom: 9,
|
|
17
|
+
BreakfastRoom: 10,
|
|
18
|
+
Carport: 11,
|
|
19
|
+
Cellar: 12,
|
|
20
|
+
Cloakroom: 13,
|
|
21
|
+
Closet: 14,
|
|
22
|
+
Conservatory: 15,
|
|
23
|
+
Corridor: 16,
|
|
24
|
+
CraftRoom: 17,
|
|
25
|
+
Cupboard: 18,
|
|
26
|
+
Deck: 19,
|
|
27
|
+
Den: 20,
|
|
28
|
+
Dining: 21,
|
|
29
|
+
DrawingRoom: 22,
|
|
30
|
+
DressingRoom: 23,
|
|
31
|
+
Driveway: 24,
|
|
32
|
+
Elevator: 25,
|
|
33
|
+
Ensuite: 26,
|
|
34
|
+
Entrance: 27,
|
|
35
|
+
Entryway: 28,
|
|
36
|
+
FamilyRoom: 29,
|
|
37
|
+
Foyer: 30,
|
|
38
|
+
FrontDoor: 31,
|
|
39
|
+
FrontYard: 32,
|
|
40
|
+
GameRoom: 33,
|
|
41
|
+
Garage: 34,
|
|
42
|
+
GarageDoor: 35,
|
|
43
|
+
Garden: 36,
|
|
44
|
+
GardenDoor: 37,
|
|
45
|
+
GuestBathroom: 38,
|
|
46
|
+
GuestBedroom: 39,
|
|
47
|
+
GuestRoom: 41,
|
|
48
|
+
Gym: 42,
|
|
49
|
+
Hallway: 43,
|
|
50
|
+
HearthRoom: 44,
|
|
51
|
+
KidsRoom: 45,
|
|
52
|
+
KidsBedroom: 46,
|
|
53
|
+
Kitchen: 47,
|
|
54
|
+
LaundryRoom: 49,
|
|
55
|
+
Lawn: 50,
|
|
56
|
+
Library: 51,
|
|
57
|
+
LivingRoom: 52,
|
|
58
|
+
Lounge: 53,
|
|
59
|
+
MediaTvRoom: 54,
|
|
60
|
+
MudRoom: 55,
|
|
61
|
+
MusicRoom: 56,
|
|
62
|
+
Nursery: 57,
|
|
63
|
+
Office: 58,
|
|
64
|
+
OutdoorKitchen: 59,
|
|
65
|
+
Outside: 60,
|
|
66
|
+
Pantry: 61,
|
|
67
|
+
ParkingLot: 62,
|
|
68
|
+
Parlor: 63,
|
|
69
|
+
Patio: 64,
|
|
70
|
+
PlayRoom: 65,
|
|
71
|
+
PoolRoom: 66,
|
|
72
|
+
Porch: 67,
|
|
73
|
+
PrimaryBathroom: 68,
|
|
74
|
+
PrimaryBedroom: 69,
|
|
75
|
+
Ramp: 70,
|
|
76
|
+
ReceptionRoom: 71,
|
|
77
|
+
RecreationRoom: 72,
|
|
78
|
+
Roof: 74,
|
|
79
|
+
Sauna: 75,
|
|
80
|
+
Scullery: 76,
|
|
81
|
+
SewingRoom: 77,
|
|
82
|
+
Shed: 78,
|
|
83
|
+
SideDoor: 79,
|
|
84
|
+
SideYard: 80,
|
|
85
|
+
SittingRoom: 81,
|
|
86
|
+
Snug: 82,
|
|
87
|
+
Spa: 83,
|
|
88
|
+
Staircase: 84,
|
|
89
|
+
SteamRoom: 85,
|
|
90
|
+
StorageRoom: 86,
|
|
91
|
+
Studio: 87,
|
|
92
|
+
Study: 88,
|
|
93
|
+
SunRoom: 89,
|
|
94
|
+
SwimmingPool: 90,
|
|
95
|
+
Terrace: 91,
|
|
96
|
+
UtilityRoom: 92,
|
|
97
|
+
Ward: 93,
|
|
98
|
+
Workshop: 94,
|
|
99
|
+
Toilet: 95,
|
|
100
|
+
};
|
|
101
|
+
/** other spellings and German names, normalised (lower case, no spaces, no umlaut dots) */
|
|
102
|
+
const SYNONYMS = {
|
|
103
|
+
livingroom: 'LivingRoom',
|
|
104
|
+
wohnzimmer: 'LivingRoom',
|
|
105
|
+
wohnen: 'LivingRoom',
|
|
106
|
+
kitchen: 'Kitchen',
|
|
107
|
+
kuche: 'Kitchen',
|
|
108
|
+
kueche: 'Kitchen',
|
|
109
|
+
bedroom: 'Bedroom',
|
|
110
|
+
schlafzimmer: 'Bedroom',
|
|
111
|
+
schlafen: 'Bedroom',
|
|
112
|
+
bathroom: 'Bathroom',
|
|
113
|
+
bad: 'Bathroom',
|
|
114
|
+
badezimmer: 'Bathroom',
|
|
115
|
+
restroom: 'Bathroom',
|
|
116
|
+
gastebad: 'GuestBathroom',
|
|
117
|
+
gaestebad: 'GuestBathroom',
|
|
118
|
+
gastezimmer: 'GuestRoom',
|
|
119
|
+
gaestezimmer: 'GuestRoom',
|
|
120
|
+
gastewc: 'Toilet',
|
|
121
|
+
gaestewc: 'Toilet',
|
|
122
|
+
wc: 'Toilet',
|
|
123
|
+
toilette: 'Toilet',
|
|
124
|
+
hallway: 'Hallway',
|
|
125
|
+
flur: 'Hallway',
|
|
126
|
+
diele: 'Hallway',
|
|
127
|
+
corridor: 'Corridor',
|
|
128
|
+
gang: 'Corridor',
|
|
129
|
+
office: 'Office',
|
|
130
|
+
buro: 'Office',
|
|
131
|
+
buero: 'Office',
|
|
132
|
+
arbeitszimmer: 'Office',
|
|
133
|
+
study: 'Study',
|
|
134
|
+
kidsroom: 'KidsRoom',
|
|
135
|
+
kinderzimmer: 'KidsRoom',
|
|
136
|
+
nursery: 'Nursery',
|
|
137
|
+
babyzimmer: 'Nursery',
|
|
138
|
+
garage: 'Garage',
|
|
139
|
+
garden: 'Garden',
|
|
140
|
+
garten: 'Garden',
|
|
141
|
+
yard: 'BackYard',
|
|
142
|
+
hof: 'BackYard',
|
|
143
|
+
cellar: 'Cellar',
|
|
144
|
+
basement: 'Cellar',
|
|
145
|
+
keller: 'Cellar',
|
|
146
|
+
attic: 'Attic',
|
|
147
|
+
dachboden: 'Attic',
|
|
148
|
+
speicher: 'Attic',
|
|
149
|
+
balcony: 'Balcony',
|
|
150
|
+
balkon: 'Balcony',
|
|
151
|
+
terrace: 'Terrace',
|
|
152
|
+
terrasse: 'Terrace',
|
|
153
|
+
patio: 'Patio',
|
|
154
|
+
dining: 'Dining',
|
|
155
|
+
diningroom: 'Dining',
|
|
156
|
+
esszimmer: 'Dining',
|
|
157
|
+
laundry: 'LaundryRoom',
|
|
158
|
+
laundryroom: 'LaundryRoom',
|
|
159
|
+
waschkuche: 'LaundryRoom',
|
|
160
|
+
waschkueche: 'LaundryRoom',
|
|
161
|
+
hauswirtschaftsraum: 'UtilityRoom',
|
|
162
|
+
hwr: 'UtilityRoom',
|
|
163
|
+
utility: 'UtilityRoom',
|
|
164
|
+
utilityroom: 'UtilityRoom',
|
|
165
|
+
pantry: 'Pantry',
|
|
166
|
+
vorratskammer: 'Pantry',
|
|
167
|
+
speisekammer: 'Pantry',
|
|
168
|
+
storage: 'StorageRoom',
|
|
169
|
+
storageroom: 'StorageRoom',
|
|
170
|
+
abstellraum: 'StorageRoom',
|
|
171
|
+
abstellkammer: 'StorageRoom',
|
|
172
|
+
closet: 'Closet',
|
|
173
|
+
kleiderschrank: 'Closet',
|
|
174
|
+
dressingroom: 'DressingRoom',
|
|
175
|
+
ankleide: 'DressingRoom',
|
|
176
|
+
ankleidezimmer: 'DressingRoom',
|
|
177
|
+
workshop: 'Workshop',
|
|
178
|
+
werkstatt: 'Workshop',
|
|
179
|
+
craftroom: 'CraftRoom',
|
|
180
|
+
bastelraum: 'CraftRoom',
|
|
181
|
+
hobbyraum: 'CraftRoom',
|
|
182
|
+
playroom: 'PlayRoom',
|
|
183
|
+
spielzimmer: 'PlayRoom',
|
|
184
|
+
gameroom: 'GameRoom',
|
|
185
|
+
spielezimmer: 'GameRoom',
|
|
186
|
+
gym: 'Gym',
|
|
187
|
+
fitnessraum: 'Gym',
|
|
188
|
+
sauna: 'Sauna',
|
|
189
|
+
pool: 'SwimmingPool',
|
|
190
|
+
swimmingpool: 'SwimmingPool',
|
|
191
|
+
schwimmbad: 'SwimmingPool',
|
|
192
|
+
entrance: 'Entrance',
|
|
193
|
+
eingang: 'Entrance',
|
|
194
|
+
eingangsbereich: 'Entrance',
|
|
195
|
+
hauseingang: 'Entrance',
|
|
196
|
+
staircase: 'Staircase',
|
|
197
|
+
stairs: 'Staircase',
|
|
198
|
+
treppe: 'Staircase',
|
|
199
|
+
treppenhaus: 'Staircase',
|
|
200
|
+
roof: 'Roof',
|
|
201
|
+
dach: 'Roof',
|
|
202
|
+
shed: 'Shed',
|
|
203
|
+
schuppen: 'Shed',
|
|
204
|
+
gartenhaus: 'Shed',
|
|
205
|
+
carport: 'Carport',
|
|
206
|
+
driveway: 'Driveway',
|
|
207
|
+
einfahrt: 'Driveway',
|
|
208
|
+
outside: 'Outside',
|
|
209
|
+
aussen: 'Outside',
|
|
210
|
+
draussen: 'Outside',
|
|
211
|
+
library: 'Library',
|
|
212
|
+
bibliothek: 'Library',
|
|
213
|
+
musicroom: 'MusicRoom',
|
|
214
|
+
musikzimmer: 'MusicRoom',
|
|
215
|
+
mediaroom: 'MediaTvRoom',
|
|
216
|
+
tvroom: 'MediaTvRoom',
|
|
217
|
+
fernsehzimmer: 'MediaTvRoom',
|
|
218
|
+
heimkino: 'MediaTvRoom',
|
|
219
|
+
lounge: 'Lounge',
|
|
220
|
+
familyroom: 'FamilyRoom',
|
|
221
|
+
frontdoor: 'FrontDoor',
|
|
222
|
+
haustur: 'FrontDoor',
|
|
223
|
+
haustuer: 'FrontDoor',
|
|
224
|
+
backdoor: 'BackDoor',
|
|
225
|
+
hintertur: 'BackDoor',
|
|
226
|
+
hintertuer: 'BackDoor',
|
|
227
|
+
conservatory: 'Conservatory',
|
|
228
|
+
wintergarten: 'Conservatory',
|
|
229
|
+
sunroom: 'SunRoom',
|
|
230
|
+
masterbedroom: 'PrimaryBedroom',
|
|
231
|
+
primarybedroom: 'PrimaryBedroom',
|
|
232
|
+
elternschlafzimmer: 'PrimaryBedroom',
|
|
233
|
+
masterbathroom: 'PrimaryBathroom',
|
|
234
|
+
primarybathroom: 'PrimaryBathroom',
|
|
235
|
+
guestroom: 'GuestRoom',
|
|
236
|
+
guestbedroom: 'GuestBedroom',
|
|
237
|
+
guestbathroom: 'GuestBathroom',
|
|
238
|
+
toilet: 'Toilet',
|
|
239
|
+
spa: 'Spa',
|
|
240
|
+
wellness: 'Spa',
|
|
241
|
+
boxroom: 'Boxroom',
|
|
242
|
+
kammer: 'Boxroom',
|
|
243
|
+
elevator: 'Elevator',
|
|
244
|
+
aufzug: 'Elevator',
|
|
245
|
+
fahrstuhl: 'Elevator',
|
|
246
|
+
studio: 'Studio',
|
|
247
|
+
atelier: 'Studio',
|
|
248
|
+
porch: 'Porch',
|
|
249
|
+
veranda: 'Porch',
|
|
250
|
+
lawn: 'Lawn',
|
|
251
|
+
rasen: 'Lawn',
|
|
252
|
+
parking: 'ParkingLot',
|
|
253
|
+
parkplatz: 'ParkingLot',
|
|
254
|
+
};
|
|
255
|
+
function normalise(name) {
|
|
256
|
+
return name
|
|
257
|
+
.toLowerCase()
|
|
258
|
+
.replace(/ä/g, 'a')
|
|
259
|
+
.replace(/ö/g, 'o')
|
|
260
|
+
.replace(/ü/g, 'u')
|
|
261
|
+
.replace(/ß/g, 'ss')
|
|
262
|
+
.replace(/[^a-z0-9]/g, '');
|
|
263
|
+
}
|
|
264
|
+
const BY_NORMALISED = new Map(Object.keys(TAGS).map((name) => [normalise(name), name]));
|
|
265
|
+
/** the Common Area tag for an area name, or undefined when the name matches none */
|
|
266
|
+
export function areaTag(name) {
|
|
267
|
+
const key = normalise(name);
|
|
268
|
+
if (key === '') {
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
const tagName = BY_NORMALISED.get(key) ?? SYNONYMS[key];
|
|
272
|
+
if (tagName === undefined) {
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
const id = TAGS[tagName];
|
|
276
|
+
return id === undefined ? undefined : { name: tagName, id };
|
|
277
|
+
}
|
|
278
|
+
export const AREA_TAGS = TAGS;
|
|
279
|
+
//# source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B,OAAO,IAAI;SACN,WAAW,EAAE;SACb,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;SACnB,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,GAAG,CAAiB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAExG,oFAAoF;AACpF,MAAM,UAAU,OAAO,CAAC,IAAY;IAChC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAqC,IAAI,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { DeviceInput } from '../../model/index.ts';
|
|
2
|
+
import type { Generated } from '../sync.ts';
|
|
3
|
+
import { type DeviceInfo, deviceIdentity, type EntityConfig, type Origin } from './types.ts';
|
|
4
|
+
export declare const SOURCE_KIND = "ha-discovery";
|
|
5
|
+
/** bumped when the generator's output for the same raw description changes */
|
|
6
|
+
export declare const GENERATOR_VERSION = 1;
|
|
7
|
+
/** what `source.raw` holds for one entity: the expanded config, trimmed of what the generator does not read */
|
|
8
|
+
export interface RawEntity {
|
|
9
|
+
/** the entity's name within the device: the topic's object id, or the component key */
|
|
10
|
+
id: string;
|
|
11
|
+
topic: string;
|
|
12
|
+
component: string;
|
|
13
|
+
config: EntityConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface RawDevice {
|
|
16
|
+
kind: 'ha';
|
|
17
|
+
prefix: string;
|
|
18
|
+
/** the first identifier or connection of the Home Assistant device */
|
|
19
|
+
identity: string;
|
|
20
|
+
device: DeviceInfo;
|
|
21
|
+
origin?: Origin;
|
|
22
|
+
entities: RawEntity[];
|
|
23
|
+
}
|
|
24
|
+
export declare function isRaw(value: unknown): value is RawDevice;
|
|
25
|
+
export declare function rawHash(raw: RawDevice): string;
|
|
26
|
+
/** a device key the schema accepts: `ha:` plus the identity, cleaned; long ones are cut and hashed */
|
|
27
|
+
export declare function deviceKey(identity: string): string;
|
|
28
|
+
/** an endpoint id the schema accepts */
|
|
29
|
+
export declare function endpointId(name: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* The key of the zigbee2mqtt importer's native description of the same device, when there is one: the
|
|
32
|
+
* identifiers zigbee2mqtt's own discovery uses (`zigbee2mqtt_<ieee>`, `zigbee2mqtt_<n>_<group id>` — with or
|
|
33
|
+
* without an `origin`, which older versions do not send), else a Zigbee IEEE address among the connections
|
|
34
|
+
* (`["zigbee", "0x…"]`, `["ieee", "…"]`) or the identifiers of another source describing a Zigbee device.
|
|
35
|
+
*/
|
|
36
|
+
export declare function nativeKey(identity: string, device?: DeviceInfo): string | undefined;
|
|
37
|
+
export declare function trimConfig(config: EntityConfig): EntityConfig;
|
|
38
|
+
export declare function trimDevice(device: DeviceInfo): DeviceInfo;
|
|
39
|
+
export declare function trimOrigin(origin: Origin | undefined): Origin | undefined;
|
|
40
|
+
/** ms a scene's outlet stays on after it was activated */
|
|
41
|
+
export declare const SCENE_MOMENTARY = 1000;
|
|
42
|
+
/** the baseline for a device description, or — when nothing of it maps onto Matter — only the reasons */
|
|
43
|
+
export declare function generateReport(raw: RawDevice): {
|
|
44
|
+
device?: DeviceInput;
|
|
45
|
+
unmapped: string[];
|
|
46
|
+
};
|
|
47
|
+
/** the baseline for a device description; undefined when nothing of it maps onto Matter */
|
|
48
|
+
export declare function generateDevice(raw: RawDevice): Generated | undefined;
|
|
49
|
+
/** regenerate the baseline from what `source.raw` holds */
|
|
50
|
+
export declare function generate(raw: RawDevice): Generated | undefined;
|
|
51
|
+
export { deviceIdentity };
|