@camstack/addon-provider-tuya 0.2.105 → 0.2.107

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
@@ -14316,6 +14316,107 @@ var ExposeInputSchema = object({
14316
14316
  });
14317
14317
  var UnexposeInputSchema = object({ deviceId: string() });
14318
14318
  method(_void(), DeviceExportStatusSchema), method(_void(), array(DeviceKindSchema)), method(_void(), array(ExposedDeviceSchema)), method(ExposeInputSchema, _void(), { kind: "mutation" }), method(UnexposeInputSchema, _void(), { kind: "mutation" });
14319
+ /** Wire/storage schema for one icon id. */
14320
+ var LocationIconIdSchema = _enum([
14321
+ "map-pin",
14322
+ "house",
14323
+ "door-open",
14324
+ "sofa",
14325
+ "utensils",
14326
+ "bed-double",
14327
+ "bath",
14328
+ "briefcase",
14329
+ "car",
14330
+ "circle-parking",
14331
+ "route",
14332
+ "trees",
14333
+ "umbrella",
14334
+ "waves-ladder",
14335
+ "fence",
14336
+ "package",
14337
+ "warehouse",
14338
+ "store",
14339
+ "sun",
14340
+ "radar"
14341
+ ]);
14342
+ /**
14343
+ * One (location, icon) assignment as it travels.
14344
+ *
14345
+ * `locationKey` is ALWAYS {@link locationIconKey} of the label — never the
14346
+ * operator's casing. The registry matches labels trimmed + case-insensitively
14347
+ * everywhere (`addLocation`, `removeLocation`, `renameLocation`), and a
14348
+ * case-only rename (`cucina` → `Cucina`) is a real edit this repo supports; a
14349
+ * map keyed on the displayed casing would orphan its entry on exactly that
14350
+ * edit. Consumers join by keying their own label through `locationIconKey`.
14351
+ */
14352
+ var LocationIconAssignmentSchema = object({
14353
+ locationKey: string(),
14354
+ icon: LocationIconIdSchema
14355
+ });
14356
+ /**
14357
+ * One (location, description) assignment as it travels.
14358
+ *
14359
+ * Same key discipline as {@link LocationIconAssignmentSchema}, and for the same
14360
+ * reason: this lived for a while in the post-analysis addon's own settings,
14361
+ * keyed by a HAND-TYPED label matched exactly and case-sensitively. A rename in
14362
+ * the Locations page carried the icon and silently orphaned the description —
14363
+ * two authorities for one thing, joined by two different rules. Now both hang
14364
+ * off the location itself, on `locationIconKey`.
14365
+ */
14366
+ var LocationDescriptionAssignmentSchema = object({
14367
+ locationKey: string(),
14368
+ description: string()
14369
+ });
14370
+ /**
14371
+ * A SITE ZONE — a named part of the property that several locations belong to.
14372
+ *
14373
+ * "Zona notte" holds every bedroom; "Zona giorno" the living room and the
14374
+ * kitchen. A camera belongs to exactly one location, and a location to at most
14375
+ * one zone, so a camera's zone is derived and never stored on the device: the
14376
+ * whole point of this entity is that grouping rooms touches no device row.
14377
+ *
14378
+ * ## Why not `zone`
14379
+ *
14380
+ * Because `zone` is already the most loaded word in this product: 612 source
14381
+ * files and 24 Italian strings where it means a DETECTION zone drawn on a
14382
+ * camera. The two are unrelated — one is a polygon in a frame, the other is a
14383
+ * set of rooms — and a reader who confuses them will look for a camera's
14384
+ * bedrooms. So the code says `siteZone` everywhere, and the UI frees the plain
14385
+ * word by calling the drawn one what it actually is: a detection zone.
14386
+ *
14387
+ * ## The key
14388
+ *
14389
+ * `siteZoneKey(label)` — trimmed, lower-cased, the SAME derivation locations
14390
+ * use (`locationIconKey`). Membership and the icon both hang off it, so a
14391
+ * case-only rename keeps them, which is exactly the orphaning that cost us a
14392
+ * silently-dropped location description.
14393
+ *
14394
+ * The icon vocabulary is the location one, unchanged: a zone is drawn on the
14395
+ * same two surfaces by the same glyph map, so a second vocabulary would be a
14396
+ * second thing to keep drawable (`scripts/check-location-icons-drawable.ts`).
14397
+ */
14398
+ /**
14399
+ * One zone as it travels: its key, the label the operator typed, its icon and
14400
+ * the locations inside it.
14401
+ *
14402
+ * The LABEL is carried alongside the key because the key is lossy on purpose —
14403
+ * a surface must show "Zona notte", not "zona notte". Locations are carried
14404
+ * here, rather than left to a second call, because every consumer wants both
14405
+ * at once and a viewer that asked twice could render a zone whose membership
14406
+ * it has not fetched yet.
14407
+ *
14408
+ * `icon: null` means nobody chose one, which is NOT the fallback pin: only one
14409
+ * of those two is a choice, and a picker has to draw them differently.
14410
+ */
14411
+ var SiteZoneSchema = object({
14412
+ zoneKey: string(),
14413
+ label: string(),
14414
+ icon: LocationIconIdSchema.nullable(),
14415
+ /** Folded location keys, sorted. A location listed here need not be
14416
+ * REGISTERED — devices carry labels nobody registered, and those rooms are
14417
+ * the ones that most want grouping. */
14418
+ locationKeys: array(string())
14419
+ });
14319
14420
  var ProviderStatusSchema = object({
14320
14421
  connected: boolean(),
14321
14422
  deviceCount: number(),
@@ -14908,6 +15009,39 @@ method(object({
14908
15009
  }), object({ moved: number() }), {
14909
15010
  kind: "mutation",
14910
15011
  auth: "admin"
15012
+ }), method(_void(), array(LocationIconAssignmentSchema)), method(object({
15013
+ location: string(),
15014
+ icon: LocationIconIdSchema.nullable()
15015
+ }), _void(), {
15016
+ kind: "mutation",
15017
+ auth: "admin"
15018
+ }), method(_void(), array(LocationDescriptionAssignmentSchema)), method(object({
15019
+ location: string(),
15020
+ description: string().max(400).nullable()
15021
+ }), _void(), {
15022
+ kind: "mutation",
15023
+ auth: "admin"
15024
+ }), method(_void(), array(SiteZoneSchema)), method(object({
15025
+ name: string(),
15026
+ icon: LocationIconIdSchema.nullable().optional()
15027
+ }), _void(), {
15028
+ kind: "mutation",
15029
+ auth: "admin"
15030
+ }), method(object({ name: string() }), _void(), {
15031
+ kind: "mutation",
15032
+ auth: "admin"
15033
+ }), method(object({
15034
+ from: string(),
15035
+ to: string()
15036
+ }), _void(), {
15037
+ kind: "mutation",
15038
+ auth: "admin"
15039
+ }), method(object({
15040
+ location: string(),
15041
+ zone: string().nullable()
15042
+ }), _void(), {
15043
+ kind: "mutation",
15044
+ auth: "admin"
14911
15045
  }), method(object({
14912
15046
  deviceId: number(),
14913
15047
  disabled: boolean()
@@ -37826,6 +37960,18 @@ Object.freeze({
37826
37960
  addonId: null,
37827
37961
  access: "view"
37828
37962
  },
37963
+ "deviceManager.listLocationDescriptions": {
37964
+ capName: "device-manager",
37965
+ capScope: "system",
37966
+ addonId: null,
37967
+ access: "view"
37968
+ },
37969
+ "deviceManager.listLocationIcons": {
37970
+ capName: "device-manager",
37971
+ capScope: "system",
37972
+ addonId: null,
37973
+ access: "view"
37974
+ },
37829
37975
  "deviceManager.listLocations": {
37830
37976
  capName: "device-manager",
37831
37977
  capScope: "system",
@@ -37838,6 +37984,12 @@ Object.freeze({
37838
37984
  addonId: null,
37839
37985
  access: "view"
37840
37986
  },
37987
+ "deviceManager.listSiteZones": {
37988
+ capName: "device-manager",
37989
+ capScope: "system",
37990
+ addonId: null,
37991
+ access: "view"
37992
+ },
37841
37993
  "deviceManager.listWrappersForCap": {
37842
37994
  capName: "device-manager",
37843
37995
  capScope: "system",
@@ -37922,12 +38074,24 @@ Object.freeze({
37922
38074
  addonId: null,
37923
38075
  access: "delete"
37924
38076
  },
38077
+ "deviceManager.removeSiteZone": {
38078
+ capName: "device-manager",
38079
+ capScope: "system",
38080
+ addonId: null,
38081
+ access: "delete"
38082
+ },
37925
38083
  "deviceManager.renameLocation": {
37926
38084
  capName: "device-manager",
37927
38085
  capScope: "system",
37928
38086
  addonId: null,
37929
38087
  access: "create"
37930
38088
  },
38089
+ "deviceManager.renameSiteZone": {
38090
+ capName: "device-manager",
38091
+ capScope: "system",
38092
+ addonId: null,
38093
+ access: "create"
38094
+ },
37931
38095
  "deviceManager.runDeviceAction": {
37932
38096
  capName: "device-manager",
37933
38097
  capScope: "system",
@@ -37970,6 +38134,24 @@ Object.freeze({
37970
38134
  addonId: null,
37971
38135
  access: "create"
37972
38136
  },
38137
+ "deviceManager.setLocationDescription": {
38138
+ capName: "device-manager",
38139
+ capScope: "system",
38140
+ addonId: null,
38141
+ access: "create"
38142
+ },
38143
+ "deviceManager.setLocationIcon": {
38144
+ capName: "device-manager",
38145
+ capScope: "system",
38146
+ addonId: null,
38147
+ access: "create"
38148
+ },
38149
+ "deviceManager.setLocationZone": {
38150
+ capName: "device-manager",
38151
+ capScope: "system",
38152
+ addonId: null,
38153
+ access: "create"
38154
+ },
37973
38155
  "deviceManager.setMetadata": {
37974
38156
  capName: "device-manager",
37975
38157
  capScope: "system",
@@ -38000,6 +38182,12 @@ Object.freeze({
38000
38182
  addonId: null,
38001
38183
  access: "create"
38002
38184
  },
38185
+ "deviceManager.setSiteZone": {
38186
+ capName: "device-manager",
38187
+ capScope: "system",
38188
+ addonId: null,
38189
+ access: "create"
38190
+ },
38003
38191
  "deviceManager.setStreamProfileMap": {
38004
38192
  capName: "device-manager",
38005
38193
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -14315,6 +14315,107 @@ var ExposeInputSchema = object({
14315
14315
  });
14316
14316
  var UnexposeInputSchema = object({ deviceId: string() });
14317
14317
  method(_void(), DeviceExportStatusSchema), method(_void(), array(DeviceKindSchema)), method(_void(), array(ExposedDeviceSchema)), method(ExposeInputSchema, _void(), { kind: "mutation" }), method(UnexposeInputSchema, _void(), { kind: "mutation" });
14318
+ /** Wire/storage schema for one icon id. */
14319
+ var LocationIconIdSchema = _enum([
14320
+ "map-pin",
14321
+ "house",
14322
+ "door-open",
14323
+ "sofa",
14324
+ "utensils",
14325
+ "bed-double",
14326
+ "bath",
14327
+ "briefcase",
14328
+ "car",
14329
+ "circle-parking",
14330
+ "route",
14331
+ "trees",
14332
+ "umbrella",
14333
+ "waves-ladder",
14334
+ "fence",
14335
+ "package",
14336
+ "warehouse",
14337
+ "store",
14338
+ "sun",
14339
+ "radar"
14340
+ ]);
14341
+ /**
14342
+ * One (location, icon) assignment as it travels.
14343
+ *
14344
+ * `locationKey` is ALWAYS {@link locationIconKey} of the label — never the
14345
+ * operator's casing. The registry matches labels trimmed + case-insensitively
14346
+ * everywhere (`addLocation`, `removeLocation`, `renameLocation`), and a
14347
+ * case-only rename (`cucina` → `Cucina`) is a real edit this repo supports; a
14348
+ * map keyed on the displayed casing would orphan its entry on exactly that
14349
+ * edit. Consumers join by keying their own label through `locationIconKey`.
14350
+ */
14351
+ var LocationIconAssignmentSchema = object({
14352
+ locationKey: string(),
14353
+ icon: LocationIconIdSchema
14354
+ });
14355
+ /**
14356
+ * One (location, description) assignment as it travels.
14357
+ *
14358
+ * Same key discipline as {@link LocationIconAssignmentSchema}, and for the same
14359
+ * reason: this lived for a while in the post-analysis addon's own settings,
14360
+ * keyed by a HAND-TYPED label matched exactly and case-sensitively. A rename in
14361
+ * the Locations page carried the icon and silently orphaned the description —
14362
+ * two authorities for one thing, joined by two different rules. Now both hang
14363
+ * off the location itself, on `locationIconKey`.
14364
+ */
14365
+ var LocationDescriptionAssignmentSchema = object({
14366
+ locationKey: string(),
14367
+ description: string()
14368
+ });
14369
+ /**
14370
+ * A SITE ZONE — a named part of the property that several locations belong to.
14371
+ *
14372
+ * "Zona notte" holds every bedroom; "Zona giorno" the living room and the
14373
+ * kitchen. A camera belongs to exactly one location, and a location to at most
14374
+ * one zone, so a camera's zone is derived and never stored on the device: the
14375
+ * whole point of this entity is that grouping rooms touches no device row.
14376
+ *
14377
+ * ## Why not `zone`
14378
+ *
14379
+ * Because `zone` is already the most loaded word in this product: 612 source
14380
+ * files and 24 Italian strings where it means a DETECTION zone drawn on a
14381
+ * camera. The two are unrelated — one is a polygon in a frame, the other is a
14382
+ * set of rooms — and a reader who confuses them will look for a camera's
14383
+ * bedrooms. So the code says `siteZone` everywhere, and the UI frees the plain
14384
+ * word by calling the drawn one what it actually is: a detection zone.
14385
+ *
14386
+ * ## The key
14387
+ *
14388
+ * `siteZoneKey(label)` — trimmed, lower-cased, the SAME derivation locations
14389
+ * use (`locationIconKey`). Membership and the icon both hang off it, so a
14390
+ * case-only rename keeps them, which is exactly the orphaning that cost us a
14391
+ * silently-dropped location description.
14392
+ *
14393
+ * The icon vocabulary is the location one, unchanged: a zone is drawn on the
14394
+ * same two surfaces by the same glyph map, so a second vocabulary would be a
14395
+ * second thing to keep drawable (`scripts/check-location-icons-drawable.ts`).
14396
+ */
14397
+ /**
14398
+ * One zone as it travels: its key, the label the operator typed, its icon and
14399
+ * the locations inside it.
14400
+ *
14401
+ * The LABEL is carried alongside the key because the key is lossy on purpose —
14402
+ * a surface must show "Zona notte", not "zona notte". Locations are carried
14403
+ * here, rather than left to a second call, because every consumer wants both
14404
+ * at once and a viewer that asked twice could render a zone whose membership
14405
+ * it has not fetched yet.
14406
+ *
14407
+ * `icon: null` means nobody chose one, which is NOT the fallback pin: only one
14408
+ * of those two is a choice, and a picker has to draw them differently.
14409
+ */
14410
+ var SiteZoneSchema = object({
14411
+ zoneKey: string(),
14412
+ label: string(),
14413
+ icon: LocationIconIdSchema.nullable(),
14414
+ /** Folded location keys, sorted. A location listed here need not be
14415
+ * REGISTERED — devices carry labels nobody registered, and those rooms are
14416
+ * the ones that most want grouping. */
14417
+ locationKeys: array(string())
14418
+ });
14318
14419
  var ProviderStatusSchema = object({
14319
14420
  connected: boolean(),
14320
14421
  deviceCount: number(),
@@ -14907,6 +15008,39 @@ method(object({
14907
15008
  }), object({ moved: number() }), {
14908
15009
  kind: "mutation",
14909
15010
  auth: "admin"
15011
+ }), method(_void(), array(LocationIconAssignmentSchema)), method(object({
15012
+ location: string(),
15013
+ icon: LocationIconIdSchema.nullable()
15014
+ }), _void(), {
15015
+ kind: "mutation",
15016
+ auth: "admin"
15017
+ }), method(_void(), array(LocationDescriptionAssignmentSchema)), method(object({
15018
+ location: string(),
15019
+ description: string().max(400).nullable()
15020
+ }), _void(), {
15021
+ kind: "mutation",
15022
+ auth: "admin"
15023
+ }), method(_void(), array(SiteZoneSchema)), method(object({
15024
+ name: string(),
15025
+ icon: LocationIconIdSchema.nullable().optional()
15026
+ }), _void(), {
15027
+ kind: "mutation",
15028
+ auth: "admin"
15029
+ }), method(object({ name: string() }), _void(), {
15030
+ kind: "mutation",
15031
+ auth: "admin"
15032
+ }), method(object({
15033
+ from: string(),
15034
+ to: string()
15035
+ }), _void(), {
15036
+ kind: "mutation",
15037
+ auth: "admin"
15038
+ }), method(object({
15039
+ location: string(),
15040
+ zone: string().nullable()
15041
+ }), _void(), {
15042
+ kind: "mutation",
15043
+ auth: "admin"
14910
15044
  }), method(object({
14911
15045
  deviceId: number(),
14912
15046
  disabled: boolean()
@@ -37825,6 +37959,18 @@ Object.freeze({
37825
37959
  addonId: null,
37826
37960
  access: "view"
37827
37961
  },
37962
+ "deviceManager.listLocationDescriptions": {
37963
+ capName: "device-manager",
37964
+ capScope: "system",
37965
+ addonId: null,
37966
+ access: "view"
37967
+ },
37968
+ "deviceManager.listLocationIcons": {
37969
+ capName: "device-manager",
37970
+ capScope: "system",
37971
+ addonId: null,
37972
+ access: "view"
37973
+ },
37828
37974
  "deviceManager.listLocations": {
37829
37975
  capName: "device-manager",
37830
37976
  capScope: "system",
@@ -37837,6 +37983,12 @@ Object.freeze({
37837
37983
  addonId: null,
37838
37984
  access: "view"
37839
37985
  },
37986
+ "deviceManager.listSiteZones": {
37987
+ capName: "device-manager",
37988
+ capScope: "system",
37989
+ addonId: null,
37990
+ access: "view"
37991
+ },
37840
37992
  "deviceManager.listWrappersForCap": {
37841
37993
  capName: "device-manager",
37842
37994
  capScope: "system",
@@ -37921,12 +38073,24 @@ Object.freeze({
37921
38073
  addonId: null,
37922
38074
  access: "delete"
37923
38075
  },
38076
+ "deviceManager.removeSiteZone": {
38077
+ capName: "device-manager",
38078
+ capScope: "system",
38079
+ addonId: null,
38080
+ access: "delete"
38081
+ },
37924
38082
  "deviceManager.renameLocation": {
37925
38083
  capName: "device-manager",
37926
38084
  capScope: "system",
37927
38085
  addonId: null,
37928
38086
  access: "create"
37929
38087
  },
38088
+ "deviceManager.renameSiteZone": {
38089
+ capName: "device-manager",
38090
+ capScope: "system",
38091
+ addonId: null,
38092
+ access: "create"
38093
+ },
37930
38094
  "deviceManager.runDeviceAction": {
37931
38095
  capName: "device-manager",
37932
38096
  capScope: "system",
@@ -37969,6 +38133,24 @@ Object.freeze({
37969
38133
  addonId: null,
37970
38134
  access: "create"
37971
38135
  },
38136
+ "deviceManager.setLocationDescription": {
38137
+ capName: "device-manager",
38138
+ capScope: "system",
38139
+ addonId: null,
38140
+ access: "create"
38141
+ },
38142
+ "deviceManager.setLocationIcon": {
38143
+ capName: "device-manager",
38144
+ capScope: "system",
38145
+ addonId: null,
38146
+ access: "create"
38147
+ },
38148
+ "deviceManager.setLocationZone": {
38149
+ capName: "device-manager",
38150
+ capScope: "system",
38151
+ addonId: null,
38152
+ access: "create"
38153
+ },
37972
38154
  "deviceManager.setMetadata": {
37973
38155
  capName: "device-manager",
37974
38156
  capScope: "system",
@@ -37999,6 +38181,12 @@ Object.freeze({
37999
38181
  addonId: null,
38000
38182
  access: "create"
38001
38183
  },
38184
+ "deviceManager.setSiteZone": {
38185
+ capName: "device-manager",
38186
+ capScope: "system",
38187
+ addonId: null,
38188
+ access: "create"
38189
+ },
38002
38190
  "deviceManager.setStreamProfileMap": {
38003
38191
  capName: "device-manager",
38004
38192
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.105",
3
+ "version": "0.2.107",
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",