@camstack/addon-provider-dreo 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 +91 -1
- package/dist/addon.mjs +91 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -35,7 +35,7 @@ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["modu
|
|
|
35
35
|
//#endregion
|
|
36
36
|
let crypto$1 = require("crypto");
|
|
37
37
|
let events = require("events");
|
|
38
|
-
//#region ../types/dist/event-category-
|
|
38
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
39
39
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
40
40
|
EventCategory["SystemBoot"] = "system.boot";
|
|
41
41
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -407,6 +407,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
407
407
|
*/
|
|
408
408
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
409
409
|
/**
|
|
410
|
+
* Cap event fired by every device that registers the `network-link`
|
|
411
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
412
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
413
|
+
* reading that moved.
|
|
414
|
+
*/
|
|
415
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
416
|
+
/**
|
|
410
417
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
411
418
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
412
419
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23802,6 +23809,88 @@ onStatusChanged: { data: object({
|
|
|
23802
23809
|
volatileStateFields: ["lastUpdated"]
|
|
23803
23810
|
};
|
|
23804
23811
|
/**
|
|
23812
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23813
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23814
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23815
|
+
* one Home Assistant projection.
|
|
23816
|
+
*/
|
|
23817
|
+
var NetworkLinkStatusSchema = object({
|
|
23818
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23819
|
+
type: _enum([
|
|
23820
|
+
"wifi",
|
|
23821
|
+
"ethernet",
|
|
23822
|
+
"cellular",
|
|
23823
|
+
"unknown"
|
|
23824
|
+
]),
|
|
23825
|
+
/**
|
|
23826
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23827
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23828
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23829
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23830
|
+
* SKIP a null rather than coerce it.
|
|
23831
|
+
*/
|
|
23832
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23833
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23834
|
+
rssiDbm: number().optional(),
|
|
23835
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23836
|
+
ssid: string().optional(),
|
|
23837
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23838
|
+
lastUpdated: number()
|
|
23839
|
+
});
|
|
23840
|
+
var networkLinkCapability = {
|
|
23841
|
+
name: "network-link",
|
|
23842
|
+
scope: "device",
|
|
23843
|
+
deviceNative: true,
|
|
23844
|
+
mode: "singleton",
|
|
23845
|
+
deviceTypes: [
|
|
23846
|
+
DeviceType.Camera,
|
|
23847
|
+
DeviceType.Sensor,
|
|
23848
|
+
DeviceType.Button,
|
|
23849
|
+
DeviceType.Switch,
|
|
23850
|
+
DeviceType.Light,
|
|
23851
|
+
DeviceType.Lock,
|
|
23852
|
+
DeviceType.Siren
|
|
23853
|
+
],
|
|
23854
|
+
methods: {},
|
|
23855
|
+
events: {
|
|
23856
|
+
/**
|
|
23857
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23858
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23859
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23860
|
+
*/
|
|
23861
|
+
onStatusChanged: { data: object({
|
|
23862
|
+
deviceId: number(),
|
|
23863
|
+
status: NetworkLinkStatusSchema
|
|
23864
|
+
}) } },
|
|
23865
|
+
status: {
|
|
23866
|
+
schema: NetworkLinkStatusSchema,
|
|
23867
|
+
kind: "push",
|
|
23868
|
+
empty: {
|
|
23869
|
+
type: "unknown",
|
|
23870
|
+
signalPercent: null,
|
|
23871
|
+
lastUpdated: 0
|
|
23872
|
+
}
|
|
23873
|
+
},
|
|
23874
|
+
/**
|
|
23875
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23876
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23877
|
+
* Home Assistant projector regardless of the driver.
|
|
23878
|
+
*/
|
|
23879
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23880
|
+
/**
|
|
23881
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23882
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23883
|
+
* restored slice is what the badge shows until the next read.
|
|
23884
|
+
*
|
|
23885
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23886
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23887
|
+
*/
|
|
23888
|
+
durability: "restored",
|
|
23889
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23890
|
+
* whether persisting is worth a SQLite commit. */
|
|
23891
|
+
volatileStateFields: ["lastUpdated"]
|
|
23892
|
+
};
|
|
23893
|
+
/**
|
|
23805
23894
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23806
23895
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23807
23896
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32194,6 +32283,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32194
32283
|
motionTrigger: motionTriggerCapability,
|
|
32195
32284
|
motionZones: motionZonesCapability,
|
|
32196
32285
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32286
|
+
networkLink: networkLinkCapability,
|
|
32197
32287
|
notifier: notifierCapability,
|
|
32198
32288
|
numericSensor: numericSensorCapability,
|
|
32199
32289
|
petFeeder: petFeederCapability,
|
package/dist/addon.mjs
CHANGED
|
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region ../types/dist/event-category-
|
|
39
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
40
40
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
41
41
|
EventCategory["SystemBoot"] = "system.boot";
|
|
42
42
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -408,6 +408,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
408
408
|
*/
|
|
409
409
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
410
410
|
/**
|
|
411
|
+
* Cap event fired by every device that registers the `network-link`
|
|
412
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
413
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
414
|
+
* reading that moved.
|
|
415
|
+
*/
|
|
416
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
417
|
+
/**
|
|
411
418
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
412
419
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
413
420
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23803,6 +23810,88 @@ onStatusChanged: { data: object({
|
|
|
23803
23810
|
volatileStateFields: ["lastUpdated"]
|
|
23804
23811
|
};
|
|
23805
23812
|
/**
|
|
23813
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23814
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23815
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23816
|
+
* one Home Assistant projection.
|
|
23817
|
+
*/
|
|
23818
|
+
var NetworkLinkStatusSchema = object({
|
|
23819
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23820
|
+
type: _enum([
|
|
23821
|
+
"wifi",
|
|
23822
|
+
"ethernet",
|
|
23823
|
+
"cellular",
|
|
23824
|
+
"unknown"
|
|
23825
|
+
]),
|
|
23826
|
+
/**
|
|
23827
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23828
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23829
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23830
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23831
|
+
* SKIP a null rather than coerce it.
|
|
23832
|
+
*/
|
|
23833
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23834
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23835
|
+
rssiDbm: number().optional(),
|
|
23836
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23837
|
+
ssid: string().optional(),
|
|
23838
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23839
|
+
lastUpdated: number()
|
|
23840
|
+
});
|
|
23841
|
+
var networkLinkCapability = {
|
|
23842
|
+
name: "network-link",
|
|
23843
|
+
scope: "device",
|
|
23844
|
+
deviceNative: true,
|
|
23845
|
+
mode: "singleton",
|
|
23846
|
+
deviceTypes: [
|
|
23847
|
+
DeviceType.Camera,
|
|
23848
|
+
DeviceType.Sensor,
|
|
23849
|
+
DeviceType.Button,
|
|
23850
|
+
DeviceType.Switch,
|
|
23851
|
+
DeviceType.Light,
|
|
23852
|
+
DeviceType.Lock,
|
|
23853
|
+
DeviceType.Siren
|
|
23854
|
+
],
|
|
23855
|
+
methods: {},
|
|
23856
|
+
events: {
|
|
23857
|
+
/**
|
|
23858
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23859
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23860
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23861
|
+
*/
|
|
23862
|
+
onStatusChanged: { data: object({
|
|
23863
|
+
deviceId: number(),
|
|
23864
|
+
status: NetworkLinkStatusSchema
|
|
23865
|
+
}) } },
|
|
23866
|
+
status: {
|
|
23867
|
+
schema: NetworkLinkStatusSchema,
|
|
23868
|
+
kind: "push",
|
|
23869
|
+
empty: {
|
|
23870
|
+
type: "unknown",
|
|
23871
|
+
signalPercent: null,
|
|
23872
|
+
lastUpdated: 0
|
|
23873
|
+
}
|
|
23874
|
+
},
|
|
23875
|
+
/**
|
|
23876
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23877
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23878
|
+
* Home Assistant projector regardless of the driver.
|
|
23879
|
+
*/
|
|
23880
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23881
|
+
/**
|
|
23882
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23883
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23884
|
+
* restored slice is what the badge shows until the next read.
|
|
23885
|
+
*
|
|
23886
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23887
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23888
|
+
*/
|
|
23889
|
+
durability: "restored",
|
|
23890
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23891
|
+
* whether persisting is worth a SQLite commit. */
|
|
23892
|
+
volatileStateFields: ["lastUpdated"]
|
|
23893
|
+
};
|
|
23894
|
+
/**
|
|
23806
23895
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23807
23896
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23808
23897
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32195,6 +32284,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32195
32284
|
motionTrigger: motionTriggerCapability,
|
|
32196
32285
|
motionZones: motionZonesCapability,
|
|
32197
32286
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32287
|
+
networkLink: networkLinkCapability,
|
|
32198
32288
|
notifier: notifierCapability,
|
|
32199
32289
|
numericSensor: numericSensorCapability,
|
|
32200
32290
|
petFeeder: petFeederCapability,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-dreo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.70",
|
|
4
4
|
"description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|