homebridge-carrier-infinity 1.7.0-beta.1 → 1.7.1
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/accessory_base.js.map +1 -1
- package/dist/accessory_comfort_activity.d.ts.map +1 -1
- package/dist/accessory_comfort_activity.js +12 -8
- package/dist/accessory_comfort_activity.js.map +1 -1
- package/dist/accessory_oat.d.ts +1 -1
- package/dist/accessory_oat.d.ts.map +1 -1
- package/dist/accessory_oat.js +3 -4
- package/dist/accessory_oat.js.map +1 -1
- package/dist/accessory_thermostat.d.ts.map +1 -1
- package/dist/accessory_thermostat.js +27 -6
- package/dist/accessory_thermostat.js.map +1 -1
- package/dist/api/constants.d.ts +6 -0
- package/dist/api/constants.d.ts.map +1 -1
- package/dist/api/constants.js +7 -1
- package/dist/api/constants.js.map +1 -1
- package/dist/api/models.d.ts +71 -79
- package/dist/api/models.d.ts.map +1 -1
- package/dist/api/models.js +440 -363
- package/dist/api/models.js.map +1 -1
- package/dist/api/oauth.d.ts +2 -2
- package/dist/api/oauth.d.ts.map +1 -1
- package/dist/api/oauth.js +0 -3
- package/dist/api/oauth.js.map +1 -1
- package/dist/api/rest_client.js +1 -1
- package/dist/api/rest_client.js.map +1 -1
- package/dist/characteristics_ac.d.ts +1 -1
- package/dist/characteristics_ac.d.ts.map +1 -1
- package/dist/characteristics_ac.js +42 -70
- package/dist/characteristics_ac.js.map +1 -1
- package/dist/characteristics_base.d.ts +6 -9
- package/dist/characteristics_base.d.ts.map +1 -1
- package/dist/characteristics_base.js +48 -57
- package/dist/characteristics_base.js.map +1 -1
- package/dist/characteristics_fan.d.ts +6 -6
- package/dist/characteristics_fan.d.ts.map +1 -1
- package/dist/characteristics_fan.js +63 -75
- package/dist/characteristics_fan.js.map +1 -1
- package/dist/characteristics_filter.d.ts +1 -1
- package/dist/characteristics_filter.d.ts.map +1 -1
- package/dist/characteristics_filter.js +8 -5
- package/dist/characteristics_filter.js.map +1 -1
- package/dist/characteristics_humidity.d.ts +5 -2
- package/dist/characteristics_humidity.d.ts.map +1 -1
- package/dist/characteristics_humidity.js +17 -9
- package/dist/characteristics_humidity.js.map +1 -1
- package/dist/helper_logging.d.ts +1 -0
- package/dist/helper_logging.d.ts.map +1 -1
- package/dist/helper_logging.js +3 -0
- package/dist/helper_logging.js.map +1 -1
- package/dist/helpers.js +7 -8
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +6 -12
- package/dist/platform.js.map +1 -1
- package/package.json +28 -28
- package/dist/api/helpers.d.ts +0 -5
- package/dist/api/helpers.d.ts.map +0 -1
- package/dist/api/helpers.js +0 -31
- package/dist/api/helpers.js.map +0 -1
- package/dist/api/helpers_rxjs.d.ts +0 -3
- package/dist/api/helpers_rxjs.d.ts.map +0 -1
- package/dist/api/helpers_rxjs.js +0 -16
- package/dist/api/helpers_rxjs.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AccessoryInformation = exports.ThermostatCharacteristicWrapper = exports.CharacteristicWrapper = exports.MultiWrapper = void 0;
|
|
4
|
+
const constants_1 = require("./api/constants");
|
|
4
5
|
const helper_logging_1 = require("./helper_logging");
|
|
5
|
-
const rxjs_1 = require("rxjs");
|
|
6
6
|
/*
|
|
7
7
|
* Helpers to add handlers to the HAP Service and Characteristic objects.
|
|
8
8
|
*/
|
|
@@ -33,36 +33,40 @@ class MultiWrapper extends Wrapper {
|
|
|
33
33
|
}
|
|
34
34
|
exports.MultiWrapper = MultiWrapper;
|
|
35
35
|
class CharacteristicWrapper extends Wrapper {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.props = {};
|
|
39
|
+
// used exclusively if no char value is set yet (first accessory load)
|
|
40
|
+
this.default_value = null;
|
|
41
|
+
}
|
|
36
42
|
wrap(service) {
|
|
37
43
|
const characteristic = service.getCharacteristic(this.ctype);
|
|
38
44
|
if (this.props) {
|
|
39
|
-
this.props
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
characteristic.setProps(this.props);
|
|
46
|
+
}
|
|
47
|
+
if (this.get) {
|
|
48
|
+
// This magic callback schedules another async callback to actually fetch
|
|
49
|
+
// and update the characteristic. This lets us convert a sync callback to
|
|
50
|
+
// an async callback.
|
|
51
|
+
const callback = () => {
|
|
52
|
+
// Schedule async update to HK characteristic.
|
|
53
|
+
process.nextTick(async () => {
|
|
54
|
+
if (this.get) {
|
|
55
|
+
characteristic.updateValue(await this.get());
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
// Return immediately with the current, stale value. This is needed for
|
|
59
|
+
// this to be a valid callback to onGet.
|
|
60
|
+
// try 1) existing value, if falsy, 2) default value, if null, 3) keep existing value
|
|
61
|
+
return characteristic.value || this.default_value || characteristic.value;
|
|
62
|
+
};
|
|
63
|
+
// Listen for HK 'get' requests. Schedule async update push to HK.
|
|
64
|
+
characteristic.onGet(callback);
|
|
65
|
+
// Listen for api updates. Schedule async update push to HK.
|
|
66
|
+
this.system.events.on(constants_1.SUBSCRIPTION.CONFIG, callback);
|
|
67
|
+
this.system.events.on(constants_1.SUBSCRIPTION.CONFIG_MUTATE, callback);
|
|
68
|
+
this.system.events.on(constants_1.SUBSCRIPTION.STATUS, callback);
|
|
42
69
|
}
|
|
43
|
-
// Push updates from the system-based value observable to HK
|
|
44
|
-
this.value.subscribe(async (data) => {
|
|
45
|
-
if (characteristic.value === data) {
|
|
46
|
-
this.log.debug(`PUSH (unnecessary) Updating ${this.ctype.name} from ${characteristic.value} to ${data}`);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
this.log.debug(`PUSH Updating ${this.ctype.name} from ${characteristic.value} to ${data}`);
|
|
50
|
-
}
|
|
51
|
-
characteristic.updateValue(data);
|
|
52
|
-
});
|
|
53
|
-
// Make HK get requests initiate an observable update
|
|
54
|
-
characteristic.onGet(async () => {
|
|
55
|
-
// Tell the system model it should update ...
|
|
56
|
-
this.system.status.events.emit('onGet');
|
|
57
|
-
this.system.config.events.emit('onGet');
|
|
58
|
-
// ... and return immediately the last seen api value.
|
|
59
|
-
const data = await (0, rxjs_1.firstValueFrom)(this.value);
|
|
60
|
-
if (characteristic.value !== data) {
|
|
61
|
-
this.log.debug(`GET Updating ${this.ctype.name} from ${characteristic.value} to ${data}`);
|
|
62
|
-
}
|
|
63
|
-
return data;
|
|
64
|
-
});
|
|
65
|
-
// Sets call set helper which calls system model
|
|
66
70
|
if (this.set) {
|
|
67
71
|
characteristic.onSet(this.set.bind(this));
|
|
68
72
|
}
|
|
@@ -71,11 +75,19 @@ class CharacteristicWrapper extends Wrapper {
|
|
|
71
75
|
exports.CharacteristicWrapper = CharacteristicWrapper;
|
|
72
76
|
class ThermostatCharacteristicWrapper extends CharacteristicWrapper {
|
|
73
77
|
// TODO: check in constructor that context has zone and hold settings
|
|
78
|
+
async getActivity() {
|
|
79
|
+
// Vacation scheduling is weird, and changes infrequently. Just get it from status.
|
|
80
|
+
if (await this.system.status.getZoneActivity(this.context.zone) === constants_1.ACTIVITY.VACATION) {
|
|
81
|
+
return constants_1.ACTIVITY.VACATION;
|
|
82
|
+
}
|
|
83
|
+
// Config has more up to date activity settings.
|
|
84
|
+
return await this.system.config.getZoneActivity(this.context.zone);
|
|
85
|
+
}
|
|
74
86
|
async getHoldTime() {
|
|
75
87
|
// OTMR setting to say when manual hold should end
|
|
76
88
|
switch (this.context.holdBehavior) {
|
|
77
89
|
case 'activity':
|
|
78
|
-
return
|
|
90
|
+
return await this.system.config.getZoneNextActivityTime(this.context.zone);
|
|
79
91
|
case 'for_x': {
|
|
80
92
|
const arg = this.context.holdArgument.split(':');
|
|
81
93
|
let target_ms = (new Date()).getTime();
|
|
@@ -94,35 +106,14 @@ class ThermostatCharacteristicWrapper extends CharacteristicWrapper {
|
|
|
94
106
|
}
|
|
95
107
|
}
|
|
96
108
|
exports.ThermostatCharacteristicWrapper = ThermostatCharacteristicWrapper;
|
|
97
|
-
class
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
constructor() {
|
|
106
|
-
super(...arguments);
|
|
107
|
-
this.ctype = this.Characteristic.Model;
|
|
108
|
-
this.value = this.system.profile.model;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
class AccessoryManufacturer extends CharacteristicWrapper {
|
|
112
|
-
constructor() {
|
|
113
|
-
super(...arguments);
|
|
114
|
-
this.ctype = this.Characteristic.Manufacturer;
|
|
115
|
-
this.value = this.system.profile.brand.pipe((0, rxjs_1.map)(x => `${x} Home`));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
class AccessoryInformation extends MultiWrapper {
|
|
119
|
-
constructor() {
|
|
120
|
-
super(...arguments);
|
|
121
|
-
this.WRAPPERS = [
|
|
122
|
-
AccessorySerial,
|
|
123
|
-
AccessoryModel,
|
|
124
|
-
AccessoryManufacturer,
|
|
125
|
-
];
|
|
109
|
+
class AccessoryInformation extends Wrapper {
|
|
110
|
+
wrap(service) {
|
|
111
|
+
this.system.profile.fetch().then(async () => {
|
|
112
|
+
service
|
|
113
|
+
.setCharacteristic(this.Characteristic.SerialNumber, this.system.serialNumber)
|
|
114
|
+
.setCharacteristic(this.Characteristic.Manufacturer, `${await this.system.profile.getBrand()} Home`)
|
|
115
|
+
.setCharacteristic(this.Characteristic.Model, await this.system.profile.getModel());
|
|
116
|
+
});
|
|
126
117
|
}
|
|
127
118
|
}
|
|
128
119
|
exports.AccessoryInformation = AccessoryInformation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_base.js","sourceRoot":"","sources":["../src/characteristics_base.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"characteristics_base.js","sourceRoot":"","sources":["../src/characteristics_base.ts"],"names":[],"mappings":";;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,EAAE,CAAC;YACZ;gBACE,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAjCD,0EAiCC;AAED,MAAa,oBAAqB,SAAQ,OAAO;IAC/C,IAAI,CAAC,OAAgB;QACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YAC1C,OAAO;iBACJ,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;iBAC7E,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC;iBACnG,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AATD,oDASC"}
|
|
@@ -2,26 +2,26 @@ import { CharacteristicValue } from 'homebridge';
|
|
|
2
2
|
import { ThermostatCharacteristicWrapper, MultiWrapper } from './characteristics_base';
|
|
3
3
|
declare class FanStatus extends ThermostatCharacteristicWrapper {
|
|
4
4
|
ctype: typeof import("hap-nodejs/dist/lib/definitions").Active;
|
|
5
|
-
|
|
5
|
+
get: () => Promise<0 | 1>;
|
|
6
6
|
set: (value: CharacteristicValue) => Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
declare class FanState extends ThermostatCharacteristicWrapper {
|
|
9
9
|
ctype: typeof import("hap-nodejs/dist/lib/definitions").CurrentFanState;
|
|
10
|
-
|
|
10
|
+
get: () => Promise<0 | 1 | 2>;
|
|
11
11
|
}
|
|
12
12
|
declare class FanSpeed extends ThermostatCharacteristicWrapper {
|
|
13
13
|
ctype: typeof import("hap-nodejs/dist/lib/definitions").RotationSpeed;
|
|
14
|
-
props:
|
|
14
|
+
props: {
|
|
15
15
|
minValue: number;
|
|
16
16
|
maxValue: number;
|
|
17
17
|
minStep: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
};
|
|
19
|
+
get: () => Promise<CharacteristicValue>;
|
|
20
20
|
set: (value: CharacteristicValue) => Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
declare class TargetFanState extends ThermostatCharacteristicWrapper {
|
|
23
23
|
ctype: typeof import("hap-nodejs/dist/lib/definitions").TargetFanState;
|
|
24
|
-
|
|
24
|
+
get: () => Promise<0 | 1>;
|
|
25
25
|
set: (value: CharacteristicValue) => Promise<void>;
|
|
26
26
|
}
|
|
27
27
|
export declare class FanService extends MultiWrapper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_fan.d.ts","sourceRoot":"","sources":["../src/characteristics_fan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"characteristics_fan.d.ts","sourceRoot":"","sources":["../src/characteristics_fan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAqBvF,cAAM,SAAU,SAAQ,+BAA+B;IACrD,KAAK,0DAA8B;IACnC,GAAG,uBAwBD;IAEF,GAAG,GAAU,OAAO,mBAAmB,mBAoBrC;CACH;AAED,cAAM,QAAS,SAAQ,+BAA+B;IACpD,KAAK,mEAAuC;IAC5C,GAAG,2BAwBD;CACH;AAED,cAAM,QAAS,SAAQ,+BAA+B;IACpD,KAAK,iEAAqC;IAC1C,KAAK;;;;MAA0C;IAE/C,GAAG,qCAID;IAEF,GAAG,GAAU,OAAO,mBAAmB,mBAcrC;CACH;AAED,cAAM,cAAe,SAAQ,+BAA+B;IAC1D,KAAK,kEAAsC;IAE3C,GAAG,uBAOD;IAEF,GAAG,GAAU,OAAO,mBAAmB,mBAgBrC;CACH;AAED,qBAAa,UAAW,SAAQ,YAAY;IAC1C,QAAQ,mFAKN;CACH"}
|
|
@@ -4,7 +4,6 @@ exports.FanService = void 0;
|
|
|
4
4
|
const characteristics_base_1 = require("./characteristics_base");
|
|
5
5
|
const helpers_1 = require("./helpers");
|
|
6
6
|
const constants_1 = require("./api/constants");
|
|
7
|
-
const rxjs_1 = require("rxjs");
|
|
8
7
|
/*
|
|
9
8
|
* Controls for system fan.
|
|
10
9
|
*
|
|
@@ -25,48 +24,42 @@ class FanStatus extends characteristics_base_1.ThermostatCharacteristicWrapper {
|
|
|
25
24
|
constructor() {
|
|
26
25
|
super(...arguments);
|
|
27
26
|
this.ctype = this.Characteristic.Active;
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.system.
|
|
32
|
-
this.system.status.getZone(this.context.zone).closed,
|
|
33
|
-
]).pipe((0, rxjs_1.debounceTime)(50), (0, rxjs_1.map)(([c_mode, c_fan, s_blowing, s_closed]) => {
|
|
34
|
-
// First, we do the absolute checks. If the status says blowing, or the system
|
|
35
|
-
// is shut off, we know the state.
|
|
36
|
-
if (s_blowing) {
|
|
37
|
-
return this.Characteristic.Active.ACTIVE;
|
|
38
|
-
}
|
|
39
|
-
else if (c_mode === constants_1.SYSTEM_MODE.OFF) {
|
|
27
|
+
this.get = async () => {
|
|
28
|
+
if (
|
|
29
|
+
// if the system is configured to be off, the fan must be off
|
|
30
|
+
await this.system.config.getMode() === constants_1.SYSTEM_MODE.OFF) {
|
|
40
31
|
return this.Characteristic.Active.INACTIVE;
|
|
41
|
-
// Second, we check for the edge case between when a user changes the state
|
|
42
|
-
// and the system picks it up. If the fan is set to on, the fan will be on
|
|
43
|
-
// soon, even though it isn't yet (which we know since blowing was false).
|
|
44
|
-
// This mitigates switch instability.
|
|
45
|
-
// However, we only do this edge case fix if the damper status is not closed,
|
|
46
|
-
// since if the damper reports it is closed, there is a good chance the
|
|
47
|
-
// config may be ignored for one reason or another. (#156)
|
|
48
32
|
}
|
|
49
|
-
else if (
|
|
50
|
-
|
|
33
|
+
else if (
|
|
34
|
+
// zone config api says manual fan mode
|
|
35
|
+
await this.system.config.getZoneActivityFan(this.context.zone, await this.getActivity()) !== constants_1.FAN_MODE.OFF ||
|
|
36
|
+
// zone status api says fan is on
|
|
37
|
+
await this.system.status.getZoneFan(this.context.zone) !== constants_1.FAN_MODE.OFF ||
|
|
38
|
+
// zone status api says zone is conditioning
|
|
39
|
+
await this.system.status.getZoneConditioning(this.context.zone) !== constants_1.SYSTEM_MODE.OFF) {
|
|
40
|
+
// but there is an exception to the above... which is the fan status/config
|
|
41
|
+
// can be wrong if the zone is actually closed off.
|
|
42
|
+
if (await this.system.status.getZoneOpen(this.context.zone)) {
|
|
43
|
+
return this.Characteristic.Active.ACTIVE;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return this.Characteristic.Active.INACTIVE;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return this.Characteristic.Active.INACTIVE;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
return this.Characteristic.Active.INACTIVE;
|
|
54
|
-
}), (0, rxjs_1.distinctUntilChanged)());
|
|
52
|
+
};
|
|
55
53
|
this.set = async (value) => {
|
|
56
54
|
// if we are trying to *turn on* fan, and system is off, set to fan only mode
|
|
57
55
|
if (value === this.Characteristic.Active.ACTIVE &&
|
|
58
|
-
await
|
|
56
|
+
await this.system.config.getMode() === constants_1.SYSTEM_MODE.OFF) {
|
|
59
57
|
return await this.system.config.setMode(constants_1.SYSTEM_MODE.FAN_ONLY);
|
|
60
58
|
}
|
|
61
59
|
// if we are trying to turn off fan, turn off fan override (i.e. set fan speed=auto)
|
|
62
60
|
// NOTE: If system is in FAN_ONLY mode, it will remain in FAN ONLY, but with speed=auto.
|
|
63
61
|
if (value === this.Characteristic.Active.INACTIVE) {
|
|
64
|
-
|
|
65
|
-
await this.system.config.setZoneActivityManualSync(this.context.zone, await (0, rxjs_1.firstValueFrom)(this.system.getZoneActivity(this.context.zone)));
|
|
66
|
-
// Update manual activity fan speed
|
|
67
|
-
await this.system.config.setZoneActivityManualFan(this.context.zone, constants_1.FAN_MODE.OFF);
|
|
68
|
-
// Enable manual activity hold
|
|
69
|
-
await this.system.config.setZoneActivityHold(this.context.zone, constants_1.ACTIVITY.MANUAL, await this.getHoldTime());
|
|
62
|
+
return await this.system.config.setZoneActivityManualHold(this.context.zone, null, null, await this.getHoldTime(), constants_1.FAN_MODE.OFF);
|
|
70
63
|
}
|
|
71
64
|
};
|
|
72
65
|
}
|
|
@@ -75,52 +68,49 @@ class FanState extends characteristics_base_1.ThermostatCharacteristicWrapper {
|
|
|
75
68
|
constructor() {
|
|
76
69
|
super(...arguments);
|
|
77
70
|
this.ctype = this.Characteristic.CurrentFanState;
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.system.
|
|
82
|
-
this.system.status.getZone(this.context.zone).closed,
|
|
83
|
-
]).pipe((0, rxjs_1.debounceTime)(50), (0, rxjs_1.map)(([c_mode, c_fan, s_blowing, s_closed]) => {
|
|
84
|
-
// First, we do the absolute checks. If the status says blowing, or the system
|
|
85
|
-
// is shut off, we know the state.
|
|
86
|
-
if (s_blowing) {
|
|
87
|
-
return this.Characteristic.CurrentFanState.BLOWING_AIR;
|
|
88
|
-
}
|
|
89
|
-
else if (c_mode === constants_1.SYSTEM_MODE.OFF) {
|
|
71
|
+
this.get = async () => {
|
|
72
|
+
if (
|
|
73
|
+
// if the system is configured to be off, the fan must be off
|
|
74
|
+
await this.system.config.getMode() === constants_1.SYSTEM_MODE.OFF) {
|
|
90
75
|
return this.Characteristic.CurrentFanState.INACTIVE;
|
|
91
|
-
// Second, we check for the edge case between when a user changes the state
|
|
92
|
-
// and the system picks it up. If the fan is set to on, the fan will be on
|
|
93
|
-
// soon, even though it isn't yet (which we know since blowing was false).
|
|
94
|
-
// This mitigates switch instability.
|
|
95
|
-
// However, we only do this edge case fix if the damper status is not closed,
|
|
96
|
-
// since if the damper reports it is closed, there is a good chance the
|
|
97
|
-
// config may be ignored for one reason or another. (#156)
|
|
98
76
|
}
|
|
99
|
-
else if (
|
|
100
|
-
|
|
77
|
+
else if (
|
|
78
|
+
// zone config api says manual fan mode
|
|
79
|
+
await this.system.config.getZoneActivityFan(this.context.zone, await this.getActivity()) !== constants_1.FAN_MODE.OFF ||
|
|
80
|
+
// zone status api says fan is on
|
|
81
|
+
await this.system.status.getZoneFan(this.context.zone) !== constants_1.FAN_MODE.OFF ||
|
|
82
|
+
// zone status api says zone is conditioning
|
|
83
|
+
await this.system.status.getZoneConditioning(this.context.zone) !== constants_1.SYSTEM_MODE.OFF) {
|
|
84
|
+
// but there is an exception to the above... which is the fan status/config
|
|
85
|
+
// can be wrong if the zone is actually closed off.
|
|
86
|
+
if (await this.system.status.getZoneOpen(this.context.zone)) {
|
|
87
|
+
return this.Characteristic.CurrentFanState.BLOWING_AIR;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return this.Characteristic.CurrentFanState.IDLE;
|
|
91
|
+
}
|
|
101
92
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
else {
|
|
94
|
+
return this.Characteristic.CurrentFanState.IDLE;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
99
|
class FanSpeed extends characteristics_base_1.ThermostatCharacteristicWrapper {
|
|
108
100
|
constructor() {
|
|
109
101
|
super(...arguments);
|
|
110
102
|
this.ctype = this.Characteristic.RotationSpeed;
|
|
111
|
-
this.props =
|
|
112
|
-
this.
|
|
103
|
+
this.props = { minValue: 0, maxValue: 3, minStep: 1 };
|
|
104
|
+
this.get = async () => {
|
|
105
|
+
return (0, helpers_1.convertSystemFan2CharFan)(await this.system.config.getZoneActivityFan(this.context.zone, await this.getActivity()));
|
|
106
|
+
};
|
|
113
107
|
this.set = async (value) => {
|
|
114
108
|
// if we are trying to control fan, and system is off, set to fan only mode
|
|
115
|
-
if (await
|
|
109
|
+
if (await this.system.config.getMode() === constants_1.SYSTEM_MODE.OFF) {
|
|
116
110
|
await this.system.config.setMode(constants_1.SYSTEM_MODE.FAN_ONLY);
|
|
117
111
|
}
|
|
118
|
-
//
|
|
119
|
-
await this.system.config.
|
|
120
|
-
// Update manual activity fan speed
|
|
121
|
-
await this.system.config.setZoneActivityManualFan(this.context.zone, (0, helpers_1.convertCharFan2SystemFan)(value));
|
|
122
|
-
// Enable manual activity hold
|
|
123
|
-
await this.system.config.setZoneActivityHold(this.context.zone, constants_1.ACTIVITY.MANUAL, await this.getHoldTime());
|
|
112
|
+
// set fan speed
|
|
113
|
+
return await this.system.config.setZoneActivityManualHold(this.context.zone, null, null, await this.getHoldTime(), (0, helpers_1.convertCharFan2SystemFan)(value));
|
|
124
114
|
};
|
|
125
115
|
}
|
|
126
116
|
}
|
|
@@ -128,22 +118,20 @@ class TargetFanState extends characteristics_base_1.ThermostatCharacteristicWrap
|
|
|
128
118
|
constructor() {
|
|
129
119
|
super(...arguments);
|
|
130
120
|
this.ctype = this.Characteristic.TargetFanState;
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
|
|
121
|
+
this.get = async () => {
|
|
122
|
+
return await this.system.config.getZoneActivityFan(this.context.zone, await this.getActivity()) === constants_1.FAN_MODE.OFF ?
|
|
123
|
+
this.Characteristic.TargetFanState.AUTO :
|
|
124
|
+
this.Characteristic.TargetFanState.MANUAL;
|
|
125
|
+
};
|
|
134
126
|
this.set = async (value) => {
|
|
135
127
|
// if we are trying to control fan, and system is off, set to fan only mode
|
|
136
|
-
if (await
|
|
128
|
+
if (await this.system.config.getMode() === constants_1.SYSTEM_MODE.OFF) {
|
|
137
129
|
await this.system.config.setMode(constants_1.SYSTEM_MODE.FAN_ONLY);
|
|
138
130
|
}
|
|
139
|
-
//
|
|
140
|
-
await this.system.config.
|
|
141
|
-
// Update manual activity fan speed to switch between auto and manual
|
|
142
|
-
await this.system.config.setZoneActivityManualFan(this.context.zone, value === this.Characteristic.TargetFanState.AUTO ?
|
|
131
|
+
// set fan speed to switch between auto and manual
|
|
132
|
+
return await this.system.config.setZoneActivityManualHold(this.context.zone, null, null, await this.getHoldTime(), value === this.Characteristic.TargetFanState.AUTO ?
|
|
143
133
|
constants_1.FAN_MODE.OFF : // fan off is auto
|
|
144
134
|
constants_1.FAN_MODE.MED);
|
|
145
|
-
// Enable manual activity hold
|
|
146
|
-
await this.system.config.setZoneActivityHold(this.context.zone, constants_1.ACTIVITY.MANUAL, await this.getHoldTime());
|
|
147
135
|
};
|
|
148
136
|
}
|
|
149
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_fan.js","sourceRoot":"","sources":["../src/characteristics_fan.ts"],"names":[],"mappings":";;;AACA,iEAAuF;AACvF,uCAA+E;AAC/E,+
|
|
1
|
+
{"version":3,"file":"characteristics_fan.js","sourceRoot":"","sources":["../src/characteristics_fan.ts"],"names":[],"mappings":";;;AACA,iEAAuF;AACvF,uCAA+E;AAC/E,+CAAwD;AAExD;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,SAAU,SAAQ,sDAA+B;IAAvD;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;QACnC,QAAG,GAAG,KAAK,IAAI,EAAE;YACf;YACE,6DAA6D;YAC7D,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,uBAAW,CAAC,GAAG,EACtD,CAAC;gBACD,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC7C,CAAC;iBAAM;YACL,uCAAuC;YACvC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,M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7 +1,7 @@
|
|
|
1
1
|
import { CharacteristicWrapper, MultiWrapper } from './characteristics_base';
|
|
2
2
|
declare class FilterLife extends CharacteristicWrapper {
|
|
3
3
|
ctype: typeof import("hap-nodejs/dist/lib/definitions").FilterLifeLevel;
|
|
4
|
-
|
|
4
|
+
get: () => Promise<number>;
|
|
5
5
|
}
|
|
6
6
|
export declare class FilterService extends MultiWrapper {
|
|
7
7
|
WRAPPERS: (typeof FilterLife)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_filter.d.ts","sourceRoot":"","sources":["../src/characteristics_filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"characteristics_filter.d.ts","sourceRoot":"","sources":["../src/characteristics_filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E,cAAM,UAAW,SAAQ,qBAAqB;IAC5C,KAAK,mEAAuC;IAC5C,GAAG,wBAED;CACH;AAWD,qBAAa,aAAc,SAAQ,YAAY;IAC7C,QAAQ,wBAGN;CACH"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FilterService = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const characteristics_base_1 = require("./characteristics_base");
|
|
6
5
|
class FilterLife extends characteristics_base_1.CharacteristicWrapper {
|
|
7
6
|
constructor() {
|
|
8
7
|
super(...arguments);
|
|
9
8
|
this.ctype = this.Characteristic.FilterLifeLevel;
|
|
10
|
-
this.
|
|
9
|
+
this.get = async () => {
|
|
10
|
+
return 100 - (await this.system.status.getFilterUsed());
|
|
11
|
+
};
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
class FilterChange extends characteristics_base_1.CharacteristicWrapper {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.ctype = this.Characteristic.FilterChangeIndication;
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
|
|
18
|
+
this.get = async () => {
|
|
19
|
+
return (await this.system.status.getFilterUsed()) > 95 ?
|
|
20
|
+
this.Characteristic.FilterChangeIndication.CHANGE_FILTER :
|
|
21
|
+
this.Characteristic.FilterChangeIndication.FILTER_OK;
|
|
22
|
+
};
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
class FilterService extends characteristics_base_1.MultiWrapper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_filter.js","sourceRoot":"","sources":["../src/characteristics_filter.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"characteristics_filter.js","sourceRoot":"","sources":["../src/characteristics_filter.ts"],"names":[],"mappings":";;;AAAA,iEAA6E;AAE7E,MAAM,UAAW,SAAQ,4CAAqB;IAA9C;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC;QAC5C,QAAG,GAAG,KAAK,IAAI,EAAE;YACf,OAAO,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,MAAM,YAAa,SAAQ,4CAAqB;IAAhD;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC;QACnD,QAAG,GAAG,KAAK,IAAI,EAAE;YACf,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;gBACtD,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;gBAC1D,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,SAAS,CAAC;QACzD,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,MAAa,aAAc,SAAQ,mCAAY;IAA/C;;QACE,aAAQ,GAAG;YACT,UAAU;YACV,YAAY;SACb,CAAC;IACJ,CAAC;CAAA;AALD,sCAKC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { CharacteristicWrapper, MultiWrapper } from './characteristics_base';
|
|
2
2
|
declare class CurrentRH extends CharacteristicWrapper {
|
|
3
3
|
ctype: typeof import("hap-nodejs/dist/lib/definitions").CurrentRelativeHumidity;
|
|
4
|
-
|
|
4
|
+
get: () => Promise<number>;
|
|
5
|
+
}
|
|
6
|
+
declare class TargetDehumidify extends CharacteristicWrapper {
|
|
7
|
+
ctype: typeof import("hap-nodejs/dist/lib/definitions").RelativeHumidityDehumidifierThreshold;
|
|
5
8
|
}
|
|
6
9
|
export declare class ThermostatRHService extends MultiWrapper {
|
|
7
10
|
WRAPPERS: (typeof CurrentRH)[];
|
|
8
11
|
}
|
|
9
12
|
export declare class HumidifierService extends MultiWrapper {
|
|
10
|
-
WRAPPERS: (typeof
|
|
13
|
+
WRAPPERS: (typeof TargetDehumidify)[];
|
|
11
14
|
}
|
|
12
15
|
export {};
|
|
13
16
|
//# sourceMappingURL=characteristics_humidity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_humidity.d.ts","sourceRoot":"","sources":["../src/characteristics_humidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E,cAAM,SAAU,SAAQ,qBAAqB;IAC3C,KAAK,2EAA+C;IACpD,KAAK,
|
|
1
|
+
{"version":3,"file":"characteristics_humidity.d.ts","sourceRoot":"","sources":["../src/characteristics_humidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E,cAAM,SAAU,SAAQ,qBAAqB;IAC3C,KAAK,2EAA+C;IACpD,GAAG,wBAED;CACH;AAED,cAAM,gBAAiB,SAAQ,qBAAqB;IAClD,KAAK,yFAA6D;CACnE;AAOD,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,QAAQ,uBAEN;CACH;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,QAAQ,8BAIN;CACH"}
|
|
@@ -6,15 +6,23 @@ class CurrentRH extends characteristics_base_1.CharacteristicWrapper {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
this.ctype = this.Characteristic.CurrentRelativeHumidity;
|
|
9
|
-
this.
|
|
9
|
+
this.get = async () => {
|
|
10
|
+
return await this.system.status.getZoneHumidity(this.context.zone);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class TargetDehumidify extends characteristics_base_1.CharacteristicWrapper {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.ctype = this.Characteristic.RelativeHumidityDehumidifierThreshold;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class TargetHumidify extends characteristics_base_1.CharacteristicWrapper {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.ctype = this.Characteristic.RelativeHumidityHumidifierThreshold;
|
|
10
24
|
}
|
|
11
25
|
}
|
|
12
|
-
// class TargetDehumidify extends CharacteristicWrapper {
|
|
13
|
-
// ctype = this.Characteristic.RelativeHumidityDehumidifierThreshold;
|
|
14
|
-
// }
|
|
15
|
-
// class TargetHumidify extends CharacteristicWrapper {
|
|
16
|
-
// ctype = this.Characteristic.RelativeHumidityHumidifierThreshold;
|
|
17
|
-
// }
|
|
18
26
|
class ThermostatRHService extends characteristics_base_1.MultiWrapper {
|
|
19
27
|
constructor() {
|
|
20
28
|
super(...arguments);
|
|
@@ -29,8 +37,8 @@ class HumidifierService extends characteristics_base_1.MultiWrapper {
|
|
|
29
37
|
super(...arguments);
|
|
30
38
|
this.WRAPPERS = [
|
|
31
39
|
CurrentRH,
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
TargetDehumidify,
|
|
41
|
+
TargetHumidify,
|
|
34
42
|
];
|
|
35
43
|
}
|
|
36
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characteristics_humidity.js","sourceRoot":"","sources":["../src/characteristics_humidity.ts"],"names":[],"mappings":";;;AAAA,iEAA6E;AAE7E,MAAM,SAAU,SAAQ,4CAAqB;IAA7C;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC;QACpD,
|
|
1
|
+
{"version":3,"file":"characteristics_humidity.js","sourceRoot":"","sources":["../src/characteristics_humidity.ts"],"names":[],"mappings":";;;AAAA,iEAA6E;AAE7E,MAAM,SAAU,SAAQ,4CAAqB;IAA7C;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC;QACpD,QAAG,GAAG,KAAK,IAAI,EAAE;YACf,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrE,CAAC,CAAC;IACJ,CAAC;CAAA;AAED,MAAM,gBAAiB,SAAQ,4CAAqB;IAApD;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,qCAAqC,CAAC;IACpE,CAAC;CAAA;AAED,MAAM,cAAe,SAAQ,4CAAqB;IAAlD;;QACE,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,mCAAmC,CAAC;IAClE,CAAC;CAAA;AAGD,MAAa,mBAAoB,SAAQ,mCAAY;IAArD;;QACE,aAAQ,GAAG;YACT,SAAS;SACV,CAAC;IACJ,CAAC;CAAA;AAJD,kDAIC;AAED,MAAa,iBAAkB,SAAQ,mCAAY;IAAnD;;QACE,aAAQ,GAAG;YACT,SAAS;YACT,gBAAgB;YAChB,cAAc;SACf,CAAC;IACJ,CAAC;CAAA;AAND,8CAMC"}
|
package/dist/helper_logging.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class PrefixLogger implements Logger {
|
|
|
4
4
|
readonly prefix: string;
|
|
5
5
|
constructor(internal: Logger, prefix: string);
|
|
6
6
|
info(message: string, ...parameters: any[]): void;
|
|
7
|
+
success(message: string, ...parameters: any[]): void;
|
|
7
8
|
warn(message: string, ...parameters: any[]): void;
|
|
8
9
|
error(message: string, ...parameters: any[]): void;
|
|
9
10
|
debug(message: string, ...parameters: any[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper_logging.d.ts","sourceRoot":"","sources":["../src/helper_logging.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9C,qBAAa,YAAa,YAAW,MAAM;IAEnC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM;gBADN,QAAQ,EAAE,MAAM,EACxB,MAAM,EAAE,MAAM;IAGtB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIlD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIlD,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;CAGzE"}
|
|
1
|
+
{"version":3,"file":"helper_logging.d.ts","sourceRoot":"","sources":["../src/helper_logging.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9C,qBAAa,YAAa,YAAW,MAAM;IAEnC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM;gBADN,QAAQ,EAAE,MAAM,EACxB,MAAM,EAAE,MAAM;IAGtB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIjD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIpD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIlD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;IAIlD,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;CAGzE"}
|
package/dist/helper_logging.js
CHANGED
|
@@ -9,6 +9,9 @@ class PrefixLogger {
|
|
|
9
9
|
info(message, ...parameters) {
|
|
10
10
|
this.log("info" /* LogLevel.INFO */, message, ...parameters);
|
|
11
11
|
}
|
|
12
|
+
success(message, ...parameters) {
|
|
13
|
+
this.log("success" /* LogLevel.SUCCESS */, message, ...parameters);
|
|
14
|
+
}
|
|
12
15
|
warn(message, ...parameters) {
|
|
13
16
|
this.log("warn" /* LogLevel.WARN */, message, ...parameters);
|
|
14
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper_logging.js","sourceRoot":"","sources":["../src/helper_logging.ts"],"names":[],"mappings":";;;AAGA,MAAa,YAAY;IACvB,YACuB,QAAgB,EACxB,MAAc;QADN,aAAQ,GAAR,QAAQ,CAAQ;QACxB,WAAM,GAAN,MAAM,CAAQ;IAC3B,CAAC;IAEI,IAAI,CAAC,OAAe,EAAE,GAAG,UAAiB;QAC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