@camstack/addon-provider-tuya 0.2.106 → 0.2.108

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/addon.js CHANGED
@@ -13112,7 +13112,23 @@ var PickStreamRequirementsSchema = object({
13112
13112
  * This is what lets one picker serve both the bypass and the full source
13113
13113
  * choice, instead of a consumer scoring privately when the bypass misses.
13114
13114
  */
13115
- allowTranscode: boolean().optional()
13115
+ allowTranscode: boolean().optional(),
13116
+ /**
13117
+ * Consider ONLY streams the broker has bound to a profile slot.
13118
+ *
13119
+ * A consumer that dials the broker — which is every exporter, since none
13120
+ * of them may open the camera's own URL — can do nothing with a source
13121
+ * that has no slot: there is no restream to dial. Without this the picker
13122
+ * can name such a stream, and each consumer discovers the dead end for
13123
+ * itself: Alexa's `profileForCamStream` returns `null` and it quietly
13124
+ * falls back, and HomeKit would have had to grow the same function again.
13125
+ *
13126
+ * Default `false`, and deliberately so: the BROKER itself picks through
13127
+ * here when it decides which source to BIND to a slot
13128
+ * (`computeInitialAssignment`), and it must see the unbound ones or it
13129
+ * could never bind them.
13130
+ */
13131
+ requireProfileBound: boolean().optional()
13116
13132
  }).readonly();
13117
13133
  var PickStreamPreferencesSchema = object({
13118
13134
  /**
@@ -13153,7 +13169,43 @@ var PickedCamStreamSchema = object({
13153
13169
  */
13154
13170
  transcodes: boolean(),
13155
13171
  /** One-line explanation of why this stream won — for logs / debug UI. */
13156
- reason: string()
13172
+ reason: string(),
13173
+ /**
13174
+ * The broker profile slot this source is bound to, when it is bound.
13175
+ *
13176
+ * Answered HERE because every consumer needs it and none of them can get it
13177
+ * from the `camStreamId` alone. Alexa wrote `profileForCamStream` for it —
13178
+ * a second cap read plus a `null` branch — and HomeKit was about to write
13179
+ * the same function a second time.
13180
+ *
13181
+ * Absent when the source has no slot, which a caller passing
13182
+ * `requireProfileBound` can never see.
13183
+ */
13184
+ profile: CamProfileSchema.optional(),
13185
+ /** The broker id of that slot, for logs that must name what was dialled. */
13186
+ brokerId: string().optional(),
13187
+ /**
13188
+ * The broker restream URL to dial for this stream.
13189
+ *
13190
+ * An exporter must never open the camera's own URL — the broker is the one
13191
+ * that dials the camera, and every consumer goes through its restream. So
13192
+ * the picker answers with the thing a consumer may actually use, instead of
13193
+ * naming a source and leaving each caller to look the URL up.
13194
+ */
13195
+ url: string().optional(),
13196
+ /**
13197
+ * Frames per second this stream really delivers, and where the number came
13198
+ * from.
13199
+ *
13200
+ * It is here because getting it wrong is expensive and silent: a HomeKit
13201
+ * accessory advertised 720p at 24 fps while the slot serving it ran at 9,
13202
+ * and the controller rendered nothing at all. The source is carried with the
13203
+ * value for the same reason the bitrate evidence is: `published` is what the
13204
+ * publisher declares and `measured` is what the broker observed, and they
13205
+ * are not interchangeable.
13206
+ */
13207
+ fps: number().positive().optional(),
13208
+ fpsSource: _enum(["published", "measured"]).optional()
13157
13209
  });
13158
13210
  /**
13159
13211
  * Camera streams — device-scoped facade over the system `stream-broker`.
@@ -14353,6 +14405,70 @@ var LocationIconAssignmentSchema = object({
14353
14405
  locationKey: string(),
14354
14406
  icon: LocationIconIdSchema
14355
14407
  });
14408
+ /**
14409
+ * One (location, description) assignment as it travels.
14410
+ *
14411
+ * Same key discipline as {@link LocationIconAssignmentSchema}, and for the same
14412
+ * reason: this lived for a while in the post-analysis addon's own settings,
14413
+ * keyed by a HAND-TYPED label matched exactly and case-sensitively. A rename in
14414
+ * the Locations page carried the icon and silently orphaned the description —
14415
+ * two authorities for one thing, joined by two different rules. Now both hang
14416
+ * off the location itself, on `locationIconKey`.
14417
+ */
14418
+ var LocationDescriptionAssignmentSchema = object({
14419
+ locationKey: string(),
14420
+ description: string()
14421
+ });
14422
+ /**
14423
+ * A SITE ZONE — a named part of the property that several locations belong to.
14424
+ *
14425
+ * "Zona notte" holds every bedroom; "Zona giorno" the living room and the
14426
+ * kitchen. A camera belongs to exactly one location, and a location to at most
14427
+ * one zone, so a camera's zone is derived and never stored on the device: the
14428
+ * whole point of this entity is that grouping rooms touches no device row.
14429
+ *
14430
+ * ## Why not `zone`
14431
+ *
14432
+ * Because `zone` is already the most loaded word in this product: 612 source
14433
+ * files and 24 Italian strings where it means a DETECTION zone drawn on a
14434
+ * camera. The two are unrelated — one is a polygon in a frame, the other is a
14435
+ * set of rooms — and a reader who confuses them will look for a camera's
14436
+ * bedrooms. So the code says `siteZone` everywhere, and the UI frees the plain
14437
+ * word by calling the drawn one what it actually is: a detection zone.
14438
+ *
14439
+ * ## The key
14440
+ *
14441
+ * `siteZoneKey(label)` — trimmed, lower-cased, the SAME derivation locations
14442
+ * use (`locationIconKey`). Membership and the icon both hang off it, so a
14443
+ * case-only rename keeps them, which is exactly the orphaning that cost us a
14444
+ * silently-dropped location description.
14445
+ *
14446
+ * The icon vocabulary is the location one, unchanged: a zone is drawn on the
14447
+ * same two surfaces by the same glyph map, so a second vocabulary would be a
14448
+ * second thing to keep drawable (`scripts/check-location-icons-drawable.ts`).
14449
+ */
14450
+ /**
14451
+ * One zone as it travels: its key, the label the operator typed, its icon and
14452
+ * the locations inside it.
14453
+ *
14454
+ * The LABEL is carried alongside the key because the key is lossy on purpose —
14455
+ * a surface must show "Zona notte", not "zona notte". Locations are carried
14456
+ * here, rather than left to a second call, because every consumer wants both
14457
+ * at once and a viewer that asked twice could render a zone whose membership
14458
+ * it has not fetched yet.
14459
+ *
14460
+ * `icon: null` means nobody chose one, which is NOT the fallback pin: only one
14461
+ * of those two is a choice, and a picker has to draw them differently.
14462
+ */
14463
+ var SiteZoneSchema = object({
14464
+ zoneKey: string(),
14465
+ label: string(),
14466
+ icon: LocationIconIdSchema.nullable(),
14467
+ /** Folded location keys, sorted. A location listed here need not be
14468
+ * REGISTERED — devices carry labels nobody registered, and those rooms are
14469
+ * the ones that most want grouping. */
14470
+ locationKeys: array(string())
14471
+ });
14356
14472
  var ProviderStatusSchema = object({
14357
14473
  connected: boolean(),
14358
14474
  deviceCount: number(),
@@ -14951,6 +15067,33 @@ method(object({
14951
15067
  }), _void(), {
14952
15068
  kind: "mutation",
14953
15069
  auth: "admin"
15070
+ }), method(_void(), array(LocationDescriptionAssignmentSchema)), method(object({
15071
+ location: string(),
15072
+ description: string().max(400).nullable()
15073
+ }), _void(), {
15074
+ kind: "mutation",
15075
+ auth: "admin"
15076
+ }), method(_void(), array(SiteZoneSchema)), method(object({
15077
+ name: string(),
15078
+ icon: LocationIconIdSchema.nullable().optional()
15079
+ }), _void(), {
15080
+ kind: "mutation",
15081
+ auth: "admin"
15082
+ }), method(object({ name: string() }), _void(), {
15083
+ kind: "mutation",
15084
+ auth: "admin"
15085
+ }), method(object({
15086
+ from: string(),
15087
+ to: string()
15088
+ }), _void(), {
15089
+ kind: "mutation",
15090
+ auth: "admin"
15091
+ }), method(object({
15092
+ location: string(),
15093
+ zone: string().nullable()
15094
+ }), _void(), {
15095
+ kind: "mutation",
15096
+ auth: "admin"
14954
15097
  }), method(object({
14955
15098
  deviceId: number(),
14956
15099
  disabled: boolean()
@@ -37869,6 +38012,12 @@ Object.freeze({
37869
38012
  addonId: null,
37870
38013
  access: "view"
37871
38014
  },
38015
+ "deviceManager.listLocationDescriptions": {
38016
+ capName: "device-manager",
38017
+ capScope: "system",
38018
+ addonId: null,
38019
+ access: "view"
38020
+ },
37872
38021
  "deviceManager.listLocationIcons": {
37873
38022
  capName: "device-manager",
37874
38023
  capScope: "system",
@@ -37887,6 +38036,12 @@ Object.freeze({
37887
38036
  addonId: null,
37888
38037
  access: "view"
37889
38038
  },
38039
+ "deviceManager.listSiteZones": {
38040
+ capName: "device-manager",
38041
+ capScope: "system",
38042
+ addonId: null,
38043
+ access: "view"
38044
+ },
37890
38045
  "deviceManager.listWrappersForCap": {
37891
38046
  capName: "device-manager",
37892
38047
  capScope: "system",
@@ -37971,12 +38126,24 @@ Object.freeze({
37971
38126
  addonId: null,
37972
38127
  access: "delete"
37973
38128
  },
38129
+ "deviceManager.removeSiteZone": {
38130
+ capName: "device-manager",
38131
+ capScope: "system",
38132
+ addonId: null,
38133
+ access: "delete"
38134
+ },
37974
38135
  "deviceManager.renameLocation": {
37975
38136
  capName: "device-manager",
37976
38137
  capScope: "system",
37977
38138
  addonId: null,
37978
38139
  access: "create"
37979
38140
  },
38141
+ "deviceManager.renameSiteZone": {
38142
+ capName: "device-manager",
38143
+ capScope: "system",
38144
+ addonId: null,
38145
+ access: "create"
38146
+ },
37980
38147
  "deviceManager.runDeviceAction": {
37981
38148
  capName: "device-manager",
37982
38149
  capScope: "system",
@@ -38019,12 +38186,24 @@ Object.freeze({
38019
38186
  addonId: null,
38020
38187
  access: "create"
38021
38188
  },
38189
+ "deviceManager.setLocationDescription": {
38190
+ capName: "device-manager",
38191
+ capScope: "system",
38192
+ addonId: null,
38193
+ access: "create"
38194
+ },
38022
38195
  "deviceManager.setLocationIcon": {
38023
38196
  capName: "device-manager",
38024
38197
  capScope: "system",
38025
38198
  addonId: null,
38026
38199
  access: "create"
38027
38200
  },
38201
+ "deviceManager.setLocationZone": {
38202
+ capName: "device-manager",
38203
+ capScope: "system",
38204
+ addonId: null,
38205
+ access: "create"
38206
+ },
38028
38207
  "deviceManager.setMetadata": {
38029
38208
  capName: "device-manager",
38030
38209
  capScope: "system",
@@ -38055,6 +38234,12 @@ Object.freeze({
38055
38234
  addonId: null,
38056
38235
  access: "create"
38057
38236
  },
38237
+ "deviceManager.setSiteZone": {
38238
+ capName: "device-manager",
38239
+ capScope: "system",
38240
+ addonId: null,
38241
+ access: "create"
38242
+ },
38058
38243
  "deviceManager.setStreamProfileMap": {
38059
38244
  capName: "device-manager",
38060
38245
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13111,7 +13111,23 @@ var PickStreamRequirementsSchema = object({
13111
13111
  * This is what lets one picker serve both the bypass and the full source
13112
13112
  * choice, instead of a consumer scoring privately when the bypass misses.
13113
13113
  */
13114
- allowTranscode: boolean().optional()
13114
+ allowTranscode: boolean().optional(),
13115
+ /**
13116
+ * Consider ONLY streams the broker has bound to a profile slot.
13117
+ *
13118
+ * A consumer that dials the broker — which is every exporter, since none
13119
+ * of them may open the camera's own URL — can do nothing with a source
13120
+ * that has no slot: there is no restream to dial. Without this the picker
13121
+ * can name such a stream, and each consumer discovers the dead end for
13122
+ * itself: Alexa's `profileForCamStream` returns `null` and it quietly
13123
+ * falls back, and HomeKit would have had to grow the same function again.
13124
+ *
13125
+ * Default `false`, and deliberately so: the BROKER itself picks through
13126
+ * here when it decides which source to BIND to a slot
13127
+ * (`computeInitialAssignment`), and it must see the unbound ones or it
13128
+ * could never bind them.
13129
+ */
13130
+ requireProfileBound: boolean().optional()
13115
13131
  }).readonly();
13116
13132
  var PickStreamPreferencesSchema = object({
13117
13133
  /**
@@ -13152,7 +13168,43 @@ var PickedCamStreamSchema = object({
13152
13168
  */
13153
13169
  transcodes: boolean(),
13154
13170
  /** One-line explanation of why this stream won — for logs / debug UI. */
13155
- reason: string()
13171
+ reason: string(),
13172
+ /**
13173
+ * The broker profile slot this source is bound to, when it is bound.
13174
+ *
13175
+ * Answered HERE because every consumer needs it and none of them can get it
13176
+ * from the `camStreamId` alone. Alexa wrote `profileForCamStream` for it —
13177
+ * a second cap read plus a `null` branch — and HomeKit was about to write
13178
+ * the same function a second time.
13179
+ *
13180
+ * Absent when the source has no slot, which a caller passing
13181
+ * `requireProfileBound` can never see.
13182
+ */
13183
+ profile: CamProfileSchema.optional(),
13184
+ /** The broker id of that slot, for logs that must name what was dialled. */
13185
+ brokerId: string().optional(),
13186
+ /**
13187
+ * The broker restream URL to dial for this stream.
13188
+ *
13189
+ * An exporter must never open the camera's own URL — the broker is the one
13190
+ * that dials the camera, and every consumer goes through its restream. So
13191
+ * the picker answers with the thing a consumer may actually use, instead of
13192
+ * naming a source and leaving each caller to look the URL up.
13193
+ */
13194
+ url: string().optional(),
13195
+ /**
13196
+ * Frames per second this stream really delivers, and where the number came
13197
+ * from.
13198
+ *
13199
+ * It is here because getting it wrong is expensive and silent: a HomeKit
13200
+ * accessory advertised 720p at 24 fps while the slot serving it ran at 9,
13201
+ * and the controller rendered nothing at all. The source is carried with the
13202
+ * value for the same reason the bitrate evidence is: `published` is what the
13203
+ * publisher declares and `measured` is what the broker observed, and they
13204
+ * are not interchangeable.
13205
+ */
13206
+ fps: number().positive().optional(),
13207
+ fpsSource: _enum(["published", "measured"]).optional()
13156
13208
  });
13157
13209
  /**
13158
13210
  * Camera streams — device-scoped facade over the system `stream-broker`.
@@ -14352,6 +14404,70 @@ var LocationIconAssignmentSchema = object({
14352
14404
  locationKey: string(),
14353
14405
  icon: LocationIconIdSchema
14354
14406
  });
14407
+ /**
14408
+ * One (location, description) assignment as it travels.
14409
+ *
14410
+ * Same key discipline as {@link LocationIconAssignmentSchema}, and for the same
14411
+ * reason: this lived for a while in the post-analysis addon's own settings,
14412
+ * keyed by a HAND-TYPED label matched exactly and case-sensitively. A rename in
14413
+ * the Locations page carried the icon and silently orphaned the description —
14414
+ * two authorities for one thing, joined by two different rules. Now both hang
14415
+ * off the location itself, on `locationIconKey`.
14416
+ */
14417
+ var LocationDescriptionAssignmentSchema = object({
14418
+ locationKey: string(),
14419
+ description: string()
14420
+ });
14421
+ /**
14422
+ * A SITE ZONE — a named part of the property that several locations belong to.
14423
+ *
14424
+ * "Zona notte" holds every bedroom; "Zona giorno" the living room and the
14425
+ * kitchen. A camera belongs to exactly one location, and a location to at most
14426
+ * one zone, so a camera's zone is derived and never stored on the device: the
14427
+ * whole point of this entity is that grouping rooms touches no device row.
14428
+ *
14429
+ * ## Why not `zone`
14430
+ *
14431
+ * Because `zone` is already the most loaded word in this product: 612 source
14432
+ * files and 24 Italian strings where it means a DETECTION zone drawn on a
14433
+ * camera. The two are unrelated — one is a polygon in a frame, the other is a
14434
+ * set of rooms — and a reader who confuses them will look for a camera's
14435
+ * bedrooms. So the code says `siteZone` everywhere, and the UI frees the plain
14436
+ * word by calling the drawn one what it actually is: a detection zone.
14437
+ *
14438
+ * ## The key
14439
+ *
14440
+ * `siteZoneKey(label)` — trimmed, lower-cased, the SAME derivation locations
14441
+ * use (`locationIconKey`). Membership and the icon both hang off it, so a
14442
+ * case-only rename keeps them, which is exactly the orphaning that cost us a
14443
+ * silently-dropped location description.
14444
+ *
14445
+ * The icon vocabulary is the location one, unchanged: a zone is drawn on the
14446
+ * same two surfaces by the same glyph map, so a second vocabulary would be a
14447
+ * second thing to keep drawable (`scripts/check-location-icons-drawable.ts`).
14448
+ */
14449
+ /**
14450
+ * One zone as it travels: its key, the label the operator typed, its icon and
14451
+ * the locations inside it.
14452
+ *
14453
+ * The LABEL is carried alongside the key because the key is lossy on purpose —
14454
+ * a surface must show "Zona notte", not "zona notte". Locations are carried
14455
+ * here, rather than left to a second call, because every consumer wants both
14456
+ * at once and a viewer that asked twice could render a zone whose membership
14457
+ * it has not fetched yet.
14458
+ *
14459
+ * `icon: null` means nobody chose one, which is NOT the fallback pin: only one
14460
+ * of those two is a choice, and a picker has to draw them differently.
14461
+ */
14462
+ var SiteZoneSchema = object({
14463
+ zoneKey: string(),
14464
+ label: string(),
14465
+ icon: LocationIconIdSchema.nullable(),
14466
+ /** Folded location keys, sorted. A location listed here need not be
14467
+ * REGISTERED — devices carry labels nobody registered, and those rooms are
14468
+ * the ones that most want grouping. */
14469
+ locationKeys: array(string())
14470
+ });
14355
14471
  var ProviderStatusSchema = object({
14356
14472
  connected: boolean(),
14357
14473
  deviceCount: number(),
@@ -14950,6 +15066,33 @@ method(object({
14950
15066
  }), _void(), {
14951
15067
  kind: "mutation",
14952
15068
  auth: "admin"
15069
+ }), method(_void(), array(LocationDescriptionAssignmentSchema)), method(object({
15070
+ location: string(),
15071
+ description: string().max(400).nullable()
15072
+ }), _void(), {
15073
+ kind: "mutation",
15074
+ auth: "admin"
15075
+ }), method(_void(), array(SiteZoneSchema)), method(object({
15076
+ name: string(),
15077
+ icon: LocationIconIdSchema.nullable().optional()
15078
+ }), _void(), {
15079
+ kind: "mutation",
15080
+ auth: "admin"
15081
+ }), method(object({ name: string() }), _void(), {
15082
+ kind: "mutation",
15083
+ auth: "admin"
15084
+ }), method(object({
15085
+ from: string(),
15086
+ to: string()
15087
+ }), _void(), {
15088
+ kind: "mutation",
15089
+ auth: "admin"
15090
+ }), method(object({
15091
+ location: string(),
15092
+ zone: string().nullable()
15093
+ }), _void(), {
15094
+ kind: "mutation",
15095
+ auth: "admin"
14953
15096
  }), method(object({
14954
15097
  deviceId: number(),
14955
15098
  disabled: boolean()
@@ -37868,6 +38011,12 @@ Object.freeze({
37868
38011
  addonId: null,
37869
38012
  access: "view"
37870
38013
  },
38014
+ "deviceManager.listLocationDescriptions": {
38015
+ capName: "device-manager",
38016
+ capScope: "system",
38017
+ addonId: null,
38018
+ access: "view"
38019
+ },
37871
38020
  "deviceManager.listLocationIcons": {
37872
38021
  capName: "device-manager",
37873
38022
  capScope: "system",
@@ -37886,6 +38035,12 @@ Object.freeze({
37886
38035
  addonId: null,
37887
38036
  access: "view"
37888
38037
  },
38038
+ "deviceManager.listSiteZones": {
38039
+ capName: "device-manager",
38040
+ capScope: "system",
38041
+ addonId: null,
38042
+ access: "view"
38043
+ },
37889
38044
  "deviceManager.listWrappersForCap": {
37890
38045
  capName: "device-manager",
37891
38046
  capScope: "system",
@@ -37970,12 +38125,24 @@ Object.freeze({
37970
38125
  addonId: null,
37971
38126
  access: "delete"
37972
38127
  },
38128
+ "deviceManager.removeSiteZone": {
38129
+ capName: "device-manager",
38130
+ capScope: "system",
38131
+ addonId: null,
38132
+ access: "delete"
38133
+ },
37973
38134
  "deviceManager.renameLocation": {
37974
38135
  capName: "device-manager",
37975
38136
  capScope: "system",
37976
38137
  addonId: null,
37977
38138
  access: "create"
37978
38139
  },
38140
+ "deviceManager.renameSiteZone": {
38141
+ capName: "device-manager",
38142
+ capScope: "system",
38143
+ addonId: null,
38144
+ access: "create"
38145
+ },
37979
38146
  "deviceManager.runDeviceAction": {
37980
38147
  capName: "device-manager",
37981
38148
  capScope: "system",
@@ -38018,12 +38185,24 @@ Object.freeze({
38018
38185
  addonId: null,
38019
38186
  access: "create"
38020
38187
  },
38188
+ "deviceManager.setLocationDescription": {
38189
+ capName: "device-manager",
38190
+ capScope: "system",
38191
+ addonId: null,
38192
+ access: "create"
38193
+ },
38021
38194
  "deviceManager.setLocationIcon": {
38022
38195
  capName: "device-manager",
38023
38196
  capScope: "system",
38024
38197
  addonId: null,
38025
38198
  access: "create"
38026
38199
  },
38200
+ "deviceManager.setLocationZone": {
38201
+ capName: "device-manager",
38202
+ capScope: "system",
38203
+ addonId: null,
38204
+ access: "create"
38205
+ },
38027
38206
  "deviceManager.setMetadata": {
38028
38207
  capName: "device-manager",
38029
38208
  capScope: "system",
@@ -38054,6 +38233,12 @@ Object.freeze({
38054
38233
  addonId: null,
38055
38234
  access: "create"
38056
38235
  },
38236
+ "deviceManager.setSiteZone": {
38237
+ capName: "device-manager",
38238
+ capScope: "system",
38239
+ addonId: null,
38240
+ access: "create"
38241
+ },
38057
38242
  "deviceManager.setStreamProfileMap": {
38058
38243
  capName: "device-manager",
38059
38244
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.106",
3
+ "version": "0.2.108",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",