@mega-yfue/eufy-sdk 0.5.0-beta.43 → 0.5.0-beta.44
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/index.js +14 -3
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/index.d.ts +7 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7891,6 +7891,10 @@ var ARMING_MEMBERS = {
|
|
|
7891
7891
|
};
|
|
7892
7892
|
}, "Turn the push notification of the device on a channel on or off in a guard mode (home/away).", (ctx) => ctx.model === "T8010")
|
|
7893
7893
|
};
|
|
7894
|
+
function decodeAlarmPhase(signal) {
|
|
7895
|
+
const type = signal.source === "push" ? signal.payload?.["type"] : void 0;
|
|
7896
|
+
return type === CusPushAlarmType.HUB_STOP_BY_APP ? { phase: "stopped" } : {};
|
|
7897
|
+
}
|
|
7894
7898
|
var ARMING = {
|
|
7895
7899
|
capability: "arming",
|
|
7896
7900
|
description: "Station/device guard (arming) mode.",
|
|
@@ -7905,8 +7909,9 @@ var ARMING = {
|
|
|
7905
7909
|
* generic `CusPushEvent` channel, so these ids are shared with other families and resolve by
|
|
7906
7910
|
* capability (see the barrel's event index).
|
|
7907
7911
|
*
|
|
7908
|
-
* The alarm ids carry a
|
|
7909
|
-
* `
|
|
7912
|
+
* The alarm ids carry a `phase` so one event name covers the whole lifecycle: the countdown push a
|
|
7913
|
+
* static `"delayed"`, the alarm push a `"triggered"` or `"stopped"` read from its alarm type (see
|
|
7914
|
+
* {@link decodeAlarmPhase}). The mode-switch push is known to identify WHICH mode and
|
|
7910
7915
|
* what triggered the change, but neither has been observed on the wire here, so this emits the bare
|
|
7911
7916
|
* transition and refreshes the `mode` read rather than trusting a decoded field.
|
|
7912
7917
|
*/
|
|
@@ -7917,7 +7922,13 @@ var ARMING = {
|
|
|
7917
7922
|
emit: "armingModeChanged",
|
|
7918
7923
|
refresh: { member: "mode" }
|
|
7919
7924
|
},
|
|
7920
|
-
{
|
|
7925
|
+
{
|
|
7926
|
+
source: "push",
|
|
7927
|
+
match: CusPushEvent.ALARM,
|
|
7928
|
+
emit: "alarm",
|
|
7929
|
+
payload: { phase: "triggered" },
|
|
7930
|
+
derive: decodeAlarmPhase
|
|
7931
|
+
},
|
|
7921
7932
|
{ source: "push", match: CusPushEvent.ALARM_DELAY, emit: "alarm", payload: { phase: "delayed" } }
|
|
7922
7933
|
]
|
|
7923
7934
|
};
|