@camstack/addon-provider-tuya 0.2.69 → 0.2.70

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
@@ -819,7 +819,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
819
819
  return [...byId.values()];
820
820
  }
821
821
  //#endregion
822
- //#region ../types/dist/event-category-BZL-fdNj.mjs
822
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
823
823
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
824
824
  EventCategory["SystemBoot"] = "system.boot";
825
825
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1191,6 +1191,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1191
1191
  */
1192
1192
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
1193
1193
  /**
1194
+ * Cap event fired by every device that registers the `network-link`
1195
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
1196
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
1197
+ * reading that moved.
1198
+ */
1199
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
1200
+ /**
1194
1201
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
1195
1202
  * "wake in progress" window — between the Baichuan wake-up issue and
1196
1203
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -24586,6 +24593,88 @@ onStatusChanged: { data: object({
24586
24593
  volatileStateFields: ["lastUpdated"]
24587
24594
  };
24588
24595
  /**
24596
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24597
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24598
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24599
+ * one Home Assistant projection.
24600
+ */
24601
+ var NetworkLinkStatusSchema = object({
24602
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24603
+ type: _enum([
24604
+ "wifi",
24605
+ "ethernet",
24606
+ "cellular",
24607
+ "unknown"
24608
+ ]),
24609
+ /**
24610
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24611
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24612
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24613
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24614
+ * SKIP a null rather than coerce it.
24615
+ */
24616
+ signalPercent: number().min(0).max(100).nullable(),
24617
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24618
+ rssiDbm: number().optional(),
24619
+ /** Network name of a wireless link, when the firmware reports it. */
24620
+ ssid: string().optional(),
24621
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24622
+ lastUpdated: number()
24623
+ });
24624
+ var networkLinkCapability = {
24625
+ name: "network-link",
24626
+ scope: "device",
24627
+ deviceNative: true,
24628
+ mode: "singleton",
24629
+ deviceTypes: [
24630
+ DeviceType.Camera,
24631
+ DeviceType.Sensor,
24632
+ DeviceType.Button,
24633
+ DeviceType.Switch,
24634
+ DeviceType.Light,
24635
+ DeviceType.Lock,
24636
+ DeviceType.Siren
24637
+ ],
24638
+ methods: {},
24639
+ events: {
24640
+ /**
24641
+ * Emitted whenever the cached status changes (a link switch, a signal
24642
+ * reading that moved). Mirrored on the parent chain by the
24643
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24644
+ */
24645
+ onStatusChanged: { data: object({
24646
+ deviceId: number(),
24647
+ status: NetworkLinkStatusSchema
24648
+ }) } },
24649
+ status: {
24650
+ schema: NetworkLinkStatusSchema,
24651
+ kind: "push",
24652
+ empty: {
24653
+ type: "unknown",
24654
+ signalPercent: null,
24655
+ lastUpdated: 0
24656
+ }
24657
+ },
24658
+ /**
24659
+ * Runtime-state slice — every provider stores the same shape under
24660
+ * `device.runtimeState['network-link']`, read once by the badge and the
24661
+ * Home Assistant projector regardless of the driver.
24662
+ */
24663
+ runtimeState: NetworkLinkStatusSchema,
24664
+ /**
24665
+ * Runtime-state durability: **restored** — a link reading is slow to
24666
+ * change and a sleeping battery camera may not report for hours; the
24667
+ * restored slice is what the badge shows until the next read.
24668
+ *
24669
+ * See `RuntimeStateDurability`. Enforced by
24670
+ * `scripts/check-runtime-state-durability.ts`.
24671
+ */
24672
+ durability: "restored",
24673
+ /** Clock fields: written, but excluded from the compare that decides
24674
+ * whether persisting is worth a SQLite commit. */
24675
+ volatileStateFields: ["lastUpdated"]
24676
+ };
24677
+ /**
24589
24678
  * Generic boolean sensor — last-resort fallback when no domain-
24590
24679
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24591
24680
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32978,6 +33067,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32978
33067
  motionTrigger: motionTriggerCapability,
32979
33068
  motionZones: motionZonesCapability,
32980
33069
  nativeObjectDetection: nativeObjectDetectionCapability,
33070
+ networkLink: networkLinkCapability,
32981
33071
  notifier: notifierCapability,
32982
33072
  numericSensor: numericSensorCapability,
32983
33073
  petFeeder: petFeederCapability,
package/dist/addon.mjs CHANGED
@@ -818,7 +818,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
818
818
  return [...byId.values()];
819
819
  }
820
820
  //#endregion
821
- //#region ../types/dist/event-category-BZL-fdNj.mjs
821
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
822
822
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
823
823
  EventCategory["SystemBoot"] = "system.boot";
824
824
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1190,6 +1190,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1190
1190
  */
1191
1191
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
1192
1192
  /**
1193
+ * Cap event fired by every device that registers the `network-link`
1194
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
1195
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
1196
+ * reading that moved.
1197
+ */
1198
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
1199
+ /**
1193
1200
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
1194
1201
  * "wake in progress" window — between the Baichuan wake-up issue and
1195
1202
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -24585,6 +24592,88 @@ onStatusChanged: { data: object({
24585
24592
  volatileStateFields: ["lastUpdated"]
24586
24593
  };
24587
24594
  /**
24595
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24596
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24597
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24598
+ * one Home Assistant projection.
24599
+ */
24600
+ var NetworkLinkStatusSchema = object({
24601
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24602
+ type: _enum([
24603
+ "wifi",
24604
+ "ethernet",
24605
+ "cellular",
24606
+ "unknown"
24607
+ ]),
24608
+ /**
24609
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24610
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24611
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24612
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24613
+ * SKIP a null rather than coerce it.
24614
+ */
24615
+ signalPercent: number().min(0).max(100).nullable(),
24616
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24617
+ rssiDbm: number().optional(),
24618
+ /** Network name of a wireless link, when the firmware reports it. */
24619
+ ssid: string().optional(),
24620
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24621
+ lastUpdated: number()
24622
+ });
24623
+ var networkLinkCapability = {
24624
+ name: "network-link",
24625
+ scope: "device",
24626
+ deviceNative: true,
24627
+ mode: "singleton",
24628
+ deviceTypes: [
24629
+ DeviceType.Camera,
24630
+ DeviceType.Sensor,
24631
+ DeviceType.Button,
24632
+ DeviceType.Switch,
24633
+ DeviceType.Light,
24634
+ DeviceType.Lock,
24635
+ DeviceType.Siren
24636
+ ],
24637
+ methods: {},
24638
+ events: {
24639
+ /**
24640
+ * Emitted whenever the cached status changes (a link switch, a signal
24641
+ * reading that moved). Mirrored on the parent chain by the
24642
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24643
+ */
24644
+ onStatusChanged: { data: object({
24645
+ deviceId: number(),
24646
+ status: NetworkLinkStatusSchema
24647
+ }) } },
24648
+ status: {
24649
+ schema: NetworkLinkStatusSchema,
24650
+ kind: "push",
24651
+ empty: {
24652
+ type: "unknown",
24653
+ signalPercent: null,
24654
+ lastUpdated: 0
24655
+ }
24656
+ },
24657
+ /**
24658
+ * Runtime-state slice — every provider stores the same shape under
24659
+ * `device.runtimeState['network-link']`, read once by the badge and the
24660
+ * Home Assistant projector regardless of the driver.
24661
+ */
24662
+ runtimeState: NetworkLinkStatusSchema,
24663
+ /**
24664
+ * Runtime-state durability: **restored** — a link reading is slow to
24665
+ * change and a sleeping battery camera may not report for hours; the
24666
+ * restored slice is what the badge shows until the next read.
24667
+ *
24668
+ * See `RuntimeStateDurability`. Enforced by
24669
+ * `scripts/check-runtime-state-durability.ts`.
24670
+ */
24671
+ durability: "restored",
24672
+ /** Clock fields: written, but excluded from the compare that decides
24673
+ * whether persisting is worth a SQLite commit. */
24674
+ volatileStateFields: ["lastUpdated"]
24675
+ };
24676
+ /**
24588
24677
  * Generic boolean sensor — last-resort fallback when no domain-
24589
24678
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24590
24679
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32977,6 +33066,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32977
33066
  motionTrigger: motionTriggerCapability,
32978
33067
  motionZones: motionZonesCapability,
32979
33068
  nativeObjectDetection: nativeObjectDetectionCapability,
33069
+ networkLink: networkLinkCapability,
32980
33070
  notifier: notifierCapability,
32981
33071
  numericSensor: numericSensorCapability,
32982
33072
  petFeeder: petFeederCapability,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.69",
3
+ "version": "0.2.70",
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",