@camstack/addon-provider-gree 0.2.68 → 0.2.69
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
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let dgram = require("dgram");
|
|
3
3
|
let crypto$1 = require("crypto");
|
|
4
4
|
let events = require("events");
|
|
5
|
-
//#region ../types/dist/event-category-
|
|
5
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
6
6
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
7
7
|
EventCategory["SystemBoot"] = "system.boot";
|
|
8
8
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -374,6 +374,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
374
374
|
*/
|
|
375
375
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
376
376
|
/**
|
|
377
|
+
* Cap event fired by every device that registers the `network-link`
|
|
378
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
379
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
380
|
+
* reading that moved.
|
|
381
|
+
*/
|
|
382
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
383
|
+
/**
|
|
377
384
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
378
385
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
379
386
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23752,6 +23759,88 @@ onStatusChanged: { data: object({
|
|
|
23752
23759
|
volatileStateFields: ["lastUpdated"]
|
|
23753
23760
|
};
|
|
23754
23761
|
/**
|
|
23762
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23763
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23764
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23765
|
+
* one Home Assistant projection.
|
|
23766
|
+
*/
|
|
23767
|
+
var NetworkLinkStatusSchema = object({
|
|
23768
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23769
|
+
type: _enum([
|
|
23770
|
+
"wifi",
|
|
23771
|
+
"ethernet",
|
|
23772
|
+
"cellular",
|
|
23773
|
+
"unknown"
|
|
23774
|
+
]),
|
|
23775
|
+
/**
|
|
23776
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23777
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23778
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23779
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23780
|
+
* SKIP a null rather than coerce it.
|
|
23781
|
+
*/
|
|
23782
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23783
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23784
|
+
rssiDbm: number().optional(),
|
|
23785
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23786
|
+
ssid: string().optional(),
|
|
23787
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23788
|
+
lastUpdated: number()
|
|
23789
|
+
});
|
|
23790
|
+
var networkLinkCapability = {
|
|
23791
|
+
name: "network-link",
|
|
23792
|
+
scope: "device",
|
|
23793
|
+
deviceNative: true,
|
|
23794
|
+
mode: "singleton",
|
|
23795
|
+
deviceTypes: [
|
|
23796
|
+
DeviceType.Camera,
|
|
23797
|
+
DeviceType.Sensor,
|
|
23798
|
+
DeviceType.Button,
|
|
23799
|
+
DeviceType.Switch,
|
|
23800
|
+
DeviceType.Light,
|
|
23801
|
+
DeviceType.Lock,
|
|
23802
|
+
DeviceType.Siren
|
|
23803
|
+
],
|
|
23804
|
+
methods: {},
|
|
23805
|
+
events: {
|
|
23806
|
+
/**
|
|
23807
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23808
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23809
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23810
|
+
*/
|
|
23811
|
+
onStatusChanged: { data: object({
|
|
23812
|
+
deviceId: number(),
|
|
23813
|
+
status: NetworkLinkStatusSchema
|
|
23814
|
+
}) } },
|
|
23815
|
+
status: {
|
|
23816
|
+
schema: NetworkLinkStatusSchema,
|
|
23817
|
+
kind: "push",
|
|
23818
|
+
empty: {
|
|
23819
|
+
type: "unknown",
|
|
23820
|
+
signalPercent: null,
|
|
23821
|
+
lastUpdated: 0
|
|
23822
|
+
}
|
|
23823
|
+
},
|
|
23824
|
+
/**
|
|
23825
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23826
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23827
|
+
* Home Assistant projector regardless of the driver.
|
|
23828
|
+
*/
|
|
23829
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23830
|
+
/**
|
|
23831
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23832
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23833
|
+
* restored slice is what the badge shows until the next read.
|
|
23834
|
+
*
|
|
23835
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23836
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23837
|
+
*/
|
|
23838
|
+
durability: "restored",
|
|
23839
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23840
|
+
* whether persisting is worth a SQLite commit. */
|
|
23841
|
+
volatileStateFields: ["lastUpdated"]
|
|
23842
|
+
};
|
|
23843
|
+
/**
|
|
23755
23844
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23756
23845
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23757
23846
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32136,6 +32225,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32136
32225
|
motionTrigger: motionTriggerCapability,
|
|
32137
32226
|
motionZones: motionZonesCapability,
|
|
32138
32227
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32228
|
+
networkLink: networkLinkCapability,
|
|
32139
32229
|
notifier: notifierCapability,
|
|
32140
32230
|
numericSensor: numericSensorCapability,
|
|
32141
32231
|
petFeeder: petFeederCapability,
|
package/dist/addon.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSocket } from "dgram";
|
|
2
2
|
import { createCipheriv, createDecipheriv } from "crypto";
|
|
3
3
|
import { EventEmitter } from "events";
|
|
4
|
-
//#region ../types/dist/event-category-
|
|
4
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
5
5
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
6
6
|
EventCategory["SystemBoot"] = "system.boot";
|
|
7
7
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -373,6 +373,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
373
373
|
*/
|
|
374
374
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
375
375
|
/**
|
|
376
|
+
* Cap event fired by every device that registers the `network-link`
|
|
377
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
378
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
379
|
+
* reading that moved.
|
|
380
|
+
*/
|
|
381
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
382
|
+
/**
|
|
376
383
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
377
384
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
378
385
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23751,6 +23758,88 @@ onStatusChanged: { data: object({
|
|
|
23751
23758
|
volatileStateFields: ["lastUpdated"]
|
|
23752
23759
|
};
|
|
23753
23760
|
/**
|
|
23761
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23762
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23763
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23764
|
+
* one Home Assistant projection.
|
|
23765
|
+
*/
|
|
23766
|
+
var NetworkLinkStatusSchema = object({
|
|
23767
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23768
|
+
type: _enum([
|
|
23769
|
+
"wifi",
|
|
23770
|
+
"ethernet",
|
|
23771
|
+
"cellular",
|
|
23772
|
+
"unknown"
|
|
23773
|
+
]),
|
|
23774
|
+
/**
|
|
23775
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23776
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23777
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23778
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23779
|
+
* SKIP a null rather than coerce it.
|
|
23780
|
+
*/
|
|
23781
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23782
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23783
|
+
rssiDbm: number().optional(),
|
|
23784
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23785
|
+
ssid: string().optional(),
|
|
23786
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23787
|
+
lastUpdated: number()
|
|
23788
|
+
});
|
|
23789
|
+
var networkLinkCapability = {
|
|
23790
|
+
name: "network-link",
|
|
23791
|
+
scope: "device",
|
|
23792
|
+
deviceNative: true,
|
|
23793
|
+
mode: "singleton",
|
|
23794
|
+
deviceTypes: [
|
|
23795
|
+
DeviceType.Camera,
|
|
23796
|
+
DeviceType.Sensor,
|
|
23797
|
+
DeviceType.Button,
|
|
23798
|
+
DeviceType.Switch,
|
|
23799
|
+
DeviceType.Light,
|
|
23800
|
+
DeviceType.Lock,
|
|
23801
|
+
DeviceType.Siren
|
|
23802
|
+
],
|
|
23803
|
+
methods: {},
|
|
23804
|
+
events: {
|
|
23805
|
+
/**
|
|
23806
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23807
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23808
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23809
|
+
*/
|
|
23810
|
+
onStatusChanged: { data: object({
|
|
23811
|
+
deviceId: number(),
|
|
23812
|
+
status: NetworkLinkStatusSchema
|
|
23813
|
+
}) } },
|
|
23814
|
+
status: {
|
|
23815
|
+
schema: NetworkLinkStatusSchema,
|
|
23816
|
+
kind: "push",
|
|
23817
|
+
empty: {
|
|
23818
|
+
type: "unknown",
|
|
23819
|
+
signalPercent: null,
|
|
23820
|
+
lastUpdated: 0
|
|
23821
|
+
}
|
|
23822
|
+
},
|
|
23823
|
+
/**
|
|
23824
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23825
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23826
|
+
* Home Assistant projector regardless of the driver.
|
|
23827
|
+
*/
|
|
23828
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23829
|
+
/**
|
|
23830
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23831
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23832
|
+
* restored slice is what the badge shows until the next read.
|
|
23833
|
+
*
|
|
23834
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23835
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23836
|
+
*/
|
|
23837
|
+
durability: "restored",
|
|
23838
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23839
|
+
* whether persisting is worth a SQLite commit. */
|
|
23840
|
+
volatileStateFields: ["lastUpdated"]
|
|
23841
|
+
};
|
|
23842
|
+
/**
|
|
23754
23843
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23755
23844
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23756
23845
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32135,6 +32224,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32135
32224
|
motionTrigger: motionTriggerCapability,
|
|
32136
32225
|
motionZones: motionZonesCapability,
|
|
32137
32226
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32227
|
+
networkLink: networkLinkCapability,
|
|
32138
32228
|
notifier: notifierCapability,
|
|
32139
32229
|
numericSensor: numericSensorCapability,
|
|
32140
32230
|
petFeeder: petFeederCapability,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-gree",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.69",
|
|
4
4
|
"description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|