@mp-consulting/homebridge-daikin-cloud 1.5.2 → 1.6.0
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/README.md +40 -27
- package/config.schema.json +66 -12
- package/dist/src/accessories/air-conditioning-accessory.js +1 -1
- package/dist/src/accessories/air-conditioning-accessory.js.map +1 -1
- package/dist/src/accessories/altherma-accessory.js +1 -1
- package/dist/src/accessories/altherma-accessory.js.map +1 -1
- package/dist/src/accessories/base-accessory.d.ts +5 -4
- package/dist/src/accessories/base-accessory.d.ts.map +1 -1
- package/dist/src/accessories/base-accessory.js +9 -10
- package/dist/src/accessories/base-accessory.js.map +1 -1
- package/dist/src/api/daikin-api.d.ts +22 -6
- package/dist/src/api/daikin-api.d.ts.map +1 -1
- package/dist/src/api/daikin-api.js +49 -23
- package/dist/src/api/daikin-api.js.map +1 -1
- package/dist/src/api/daikin-controller.d.ts +4 -48
- package/dist/src/api/daikin-controller.d.ts.map +1 -1
- package/dist/src/api/daikin-controller.js +14 -84
- package/dist/src/api/daikin-controller.js.map +1 -1
- package/dist/src/api/daikin-mobile-oauth.d.ts +11 -40
- package/dist/src/api/daikin-mobile-oauth.d.ts.map +1 -1
- package/dist/src/api/daikin-mobile-oauth.js +36 -160
- package/dist/src/api/daikin-mobile-oauth.js.map +1 -1
- package/dist/src/api/daikin-oauth.d.ts +10 -37
- package/dist/src/api/daikin-oauth.d.ts.map +1 -1
- package/dist/src/api/daikin-oauth.js +36 -166
- package/dist/src/api/daikin-oauth.js.map +1 -1
- package/dist/src/api/daikin-schemas.d.ts +20 -22
- package/dist/src/api/daikin-schemas.d.ts.map +1 -1
- package/dist/src/api/daikin-schemas.js +17 -49
- package/dist/src/api/daikin-schemas.js.map +1 -1
- package/dist/src/api/daikin-types.d.ts +11 -23
- package/dist/src/api/daikin-types.d.ts.map +1 -1
- package/dist/src/api/daikin-types.js.map +1 -1
- package/dist/src/api/daikin-websocket.d.ts +4 -5
- package/dist/src/api/daikin-websocket.d.ts.map +1 -1
- package/dist/src/api/daikin-websocket.js +62 -34
- package/dist/src/api/daikin-websocket.js.map +1 -1
- package/dist/src/api/http-defaults.d.ts +3 -2
- package/dist/src/api/http-defaults.d.ts.map +1 -1
- package/dist/src/api/http-defaults.js.map +1 -1
- package/dist/src/api/http-transport.d.ts +14 -2
- package/dist/src/api/http-transport.d.ts.map +1 -1
- package/dist/src/api/http-transport.js +32 -9
- package/dist/src/api/http-transport.js.map +1 -1
- package/dist/src/api/token-client.d.ts +82 -0
- package/dist/src/api/token-client.d.ts.map +1 -0
- package/dist/src/api/token-client.js +188 -0
- package/dist/src/api/token-client.js.map +1 -0
- package/dist/src/api/token-storage.d.ts +6 -0
- package/dist/src/api/token-storage.d.ts.map +1 -1
- package/dist/src/api/token-storage.js +27 -1
- package/dist/src/api/token-storage.js.map +1 -1
- package/dist/src/config/config-manager.d.ts +69 -125
- package/dist/src/config/config-manager.d.ts.map +1 -1
- package/dist/src/config/config-manager.js +288 -225
- package/dist/src/config/config-manager.js.map +1 -1
- package/dist/src/constants/api.constants.d.ts +6 -0
- package/dist/src/constants/api.constants.d.ts.map +1 -1
- package/dist/src/constants/api.constants.js +7 -1
- package/dist/src/constants/api.constants.js.map +1 -1
- package/dist/src/constants/auth.constants.d.ts +11 -0
- package/dist/src/constants/auth.constants.d.ts.map +1 -1
- package/dist/src/constants/auth.constants.js +12 -1
- package/dist/src/constants/auth.constants.js.map +1 -1
- package/dist/src/constants/device.constants.d.ts +1 -7
- package/dist/src/constants/device.constants.d.ts.map +1 -1
- package/dist/src/constants/device.constants.js +2 -11
- package/dist/src/constants/device.constants.js.map +1 -1
- package/dist/src/constants/time.constants.d.ts +0 -2
- package/dist/src/constants/time.constants.d.ts.map +1 -1
- package/dist/src/constants/time.constants.js +1 -3
- package/dist/src/constants/time.constants.js.map +1 -1
- package/dist/src/device/accessory-factory.d.ts +0 -5
- package/dist/src/device/accessory-factory.d.ts.map +1 -1
- package/dist/src/device/accessory-factory.js +0 -7
- package/dist/src/device/accessory-factory.js.map +1 -1
- package/dist/src/device/capability-detector.d.ts +9 -1
- package/dist/src/device/capability-detector.d.ts.map +1 -1
- package/dist/src/device/capability-detector.js +32 -28
- package/dist/src/device/capability-detector.js.map +1 -1
- package/dist/src/device/capability-docs.d.ts.map +1 -1
- package/dist/src/device/capability-docs.js +3 -0
- package/dist/src/device/capability-docs.js.map +1 -1
- package/dist/src/device/data-paths.d.ts +18 -0
- package/dist/src/device/data-paths.d.ts.map +1 -0
- package/dist/src/device/data-paths.js +20 -0
- package/dist/src/device/data-paths.js.map +1 -0
- package/dist/src/device/profiles/device-profile.d.ts +0 -5
- package/dist/src/device/profiles/device-profile.d.ts.map +1 -1
- package/dist/src/device/profiles/device-profile.js +0 -21
- package/dist/src/device/profiles/device-profile.js.map +1 -1
- package/dist/src/features/base-feature.d.ts +53 -9
- package/dist/src/features/base-feature.d.ts.map +1 -1
- package/dist/src/features/base-feature.js +93 -40
- package/dist/src/features/base-feature.js.map +1 -1
- package/dist/src/features/feature-manager.d.ts +27 -15
- package/dist/src/features/feature-manager.d.ts.map +1 -1
- package/dist/src/features/feature-manager.js +27 -24
- package/dist/src/features/feature-manager.js.map +1 -1
- package/dist/src/features/index.d.ts +1 -0
- package/dist/src/features/index.d.ts.map +1 -1
- package/dist/src/features/index.js +1 -0
- package/dist/src/features/index.js.map +1 -1
- package/dist/src/features/modes/auto-fan-mode.feature.d.ts +16 -10
- package/dist/src/features/modes/auto-fan-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/auto-fan-mode.feature.js +16 -40
- package/dist/src/features/modes/auto-fan-mode.feature.js.map +1 -1
- package/dist/src/features/modes/dry-operation-mode.feature.d.ts +12 -9
- package/dist/src/features/modes/dry-operation-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/dry-operation-mode.feature.js +11 -30
- package/dist/src/features/modes/dry-operation-mode.feature.js.map +1 -1
- package/dist/src/features/modes/econo-mode.feature.d.ts +12 -9
- package/dist/src/features/modes/econo-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/econo-mode.feature.js +11 -31
- package/dist/src/features/modes/econo-mode.feature.js.map +1 -1
- package/dist/src/features/modes/fan-only-operation-mode.feature.d.ts +12 -9
- package/dist/src/features/modes/fan-only-operation-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/fan-only-operation-mode.feature.js +11 -30
- package/dist/src/features/modes/fan-only-operation-mode.feature.js.map +1 -1
- package/dist/src/features/modes/firmware-update.feature.d.ts +7 -6
- package/dist/src/features/modes/firmware-update.feature.d.ts.map +1 -1
- package/dist/src/features/modes/firmware-update.feature.js +15 -22
- package/dist/src/features/modes/firmware-update.feature.js.map +1 -1
- package/dist/src/features/modes/holiday-mode.feature.d.ts +2 -1
- package/dist/src/features/modes/holiday-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/holiday-mode.feature.js +5 -15
- package/dist/src/features/modes/holiday-mode.feature.js.map +1 -1
- package/dist/src/features/modes/indoor-silent-mode.feature.d.ts +15 -12
- package/dist/src/features/modes/indoor-silent-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/indoor-silent-mode.feature.js +15 -39
- package/dist/src/features/modes/indoor-silent-mode.feature.js.map +1 -1
- package/dist/src/features/modes/oscillation-mode.feature.d.ts +5 -6
- package/dist/src/features/modes/oscillation-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/oscillation-mode.feature.js +14 -36
- package/dist/src/features/modes/oscillation-mode.feature.js.map +1 -1
- package/dist/src/features/modes/outdoor-silent-mode.feature.d.ts +12 -9
- package/dist/src/features/modes/outdoor-silent-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/outdoor-silent-mode.feature.js +11 -31
- package/dist/src/features/modes/outdoor-silent-mode.feature.js.map +1 -1
- package/dist/src/features/modes/powerful-mode.feature.d.ts +14 -10
- package/dist/src/features/modes/powerful-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/powerful-mode.feature.js +13 -32
- package/dist/src/features/modes/powerful-mode.feature.js.map +1 -1
- package/dist/src/features/modes/streamer-mode.feature.d.ts +12 -9
- package/dist/src/features/modes/streamer-mode.feature.d.ts.map +1 -1
- package/dist/src/features/modes/streamer-mode.feature.js +11 -31
- package/dist/src/features/modes/streamer-mode.feature.js.map +1 -1
- package/dist/src/features/on-off-data-point-feature.d.ts +43 -0
- package/dist/src/features/on-off-data-point-feature.d.ts.map +1 -0
- package/dist/src/features/on-off-data-point-feature.js +49 -0
- package/dist/src/features/on-off-data-point-feature.js.map +1 -0
- package/dist/src/platform.d.ts +56 -9
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/platform.js +248 -128
- package/dist/src/platform.js.map +1 -1
- package/dist/src/services/climate-control/fan-speed.d.ts +45 -0
- package/dist/src/services/climate-control/fan-speed.d.ts.map +1 -0
- package/dist/src/services/climate-control/fan-speed.js +104 -0
- package/dist/src/services/climate-control/fan-speed.js.map +1 -0
- package/dist/src/services/climate-control/separate-fan.service.d.ts +45 -0
- package/dist/src/services/climate-control/separate-fan.service.d.ts.map +1 -0
- package/dist/src/services/climate-control/separate-fan.service.js +82 -0
- package/dist/src/services/climate-control/separate-fan.service.js.map +1 -0
- package/dist/src/services/climate-control/setpoint-resolver.d.ts +68 -0
- package/dist/src/services/climate-control/setpoint-resolver.d.ts.map +1 -0
- package/dist/src/services/climate-control/setpoint-resolver.js +170 -0
- package/dist/src/services/climate-control/setpoint-resolver.js.map +1 -0
- package/dist/src/services/climate-control/swing-controller.d.ts +28 -0
- package/dist/src/services/climate-control/swing-controller.d.ts.map +1 -0
- package/dist/src/services/climate-control/swing-controller.js +65 -0
- package/dist/src/services/climate-control/swing-controller.js.map +1 -0
- package/dist/src/services/climate-control.service.d.ts +39 -48
- package/dist/src/services/climate-control.service.d.ts.map +1 -1
- package/dist/src/services/climate-control.service.js +223 -554
- package/dist/src/services/climate-control.service.js.map +1 -1
- package/dist/src/services/hot-water-tank.service.d.ts +17 -8
- package/dist/src/services/hot-water-tank.service.d.ts.map +1 -1
- package/dist/src/services/hot-water-tank.service.js +102 -157
- package/dist/src/services/hot-water-tank.service.js.map +1 -1
- package/dist/src/types/daikin-enums.d.ts +0 -5
- package/dist/src/types/daikin-enums.d.ts.map +1 -1
- package/dist/src/types/daikin-enums.js +1 -7
- package/dist/src/types/daikin-enums.js.map +1 -1
- package/dist/src/types/device-capabilities.d.ts +1 -0
- package/dist/src/types/device-capabilities.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +9 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +25 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/hap-write.d.ts +22 -0
- package/dist/src/utils/hap-write.d.ts.map +1 -0
- package/dist/src/utils/hap-write.js +33 -0
- package/dist/src/utils/hap-write.js.map +1 -0
- package/dist/src/utils/sleep.d.ts +5 -0
- package/dist/src/utils/sleep.d.ts.map +1 -0
- package/dist/src/utils/sleep.js +10 -0
- package/dist/src/utils/sleep.js.map +1 -0
- package/homebridge-ui/README.md +25 -2
- package/homebridge-ui/public/index.html +19 -17
- package/homebridge-ui/public/script.js +95 -32
- package/homebridge-ui/public/styles.css +109 -0
- package/homebridge-ui/server.js +321 -125
- package/package.json +2 -3
- package/dist/src/utils/log-context.d.ts +0 -105
- package/dist/src/utils/log-context.d.ts.map +0 -1
- package/dist/src/utils/log-context.js +0 -206
- package/dist/src/utils/log-context.js.map +0 -1
- package/dist/src/utils/update-mapper.d.ts +0 -59
- package/dist/src/utils/update-mapper.d.ts.map +0 -1
- package/dist/src/utils/update-mapper.js +0 -192
- package/dist/src/utils/update-mapper.js.map +0 -1
|
@@ -2,49 +2,25 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Indoor Silent Mode Feature
|
|
4
4
|
*
|
|
5
|
-
* Enables/disables the indoor silent (quiet) mode on the device
|
|
6
|
-
*
|
|
5
|
+
* Enables/disables the indoor silent (quiet) mode on the device by switching
|
|
6
|
+
* fanSpeed/currentMode of the current operation mode between 'quiet' and 'fixed'.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.IndoorSilentModeFeature = void 0;
|
|
10
|
-
const
|
|
10
|
+
const on_off_data_point_feature_1 = require("../on-off-data-point-feature");
|
|
11
11
|
const types_1 = require("../../types");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (!currentModeFanControl) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
const fanSpeedValues = currentModeFanControl.values || [];
|
|
28
|
-
const hasQuietMode = fanSpeedValues.includes(types_1.DaikinFanSpeedModes.QUIET);
|
|
29
|
-
this.log.debug(`[${this.name}] hasIndoorSilentModeFeature: ${hasQuietMode}`);
|
|
30
|
-
return hasQuietMode;
|
|
31
|
-
}
|
|
32
|
-
async handleGet() {
|
|
33
|
-
const data = this.getData('fanControl', `/operationModes/${this.getCurrentOperationMode()}/fanSpeed/currentMode`);
|
|
34
|
-
const isOn = data?.value === types_1.DaikinFanSpeedModes.QUIET;
|
|
35
|
-
this.log.debug(`[${this.name}] GET IndoorSilentMode: ${isOn}, ` +
|
|
36
|
-
`last update: ${this.accessory.context.device.getLastUpdated()}`);
|
|
37
|
-
return isOn;
|
|
38
|
-
}
|
|
39
|
-
async handleSet(value) {
|
|
40
|
-
this.log.debug(`[${this.name}] SET IndoorSilentMode to: ${value}`);
|
|
41
|
-
const mode = value ? types_1.DaikinFanSpeedModes.QUIET : types_1.DaikinFanSpeedModes.FIXED;
|
|
42
|
-
await this.setData('fanControl', mode, `/operationModes/${this.getCurrentOperationMode()}/fanSpeed/currentMode`);
|
|
43
|
-
}
|
|
44
|
-
getCurrentOperationMode() {
|
|
45
|
-
const data = this.getData('operationMode');
|
|
46
|
-
return data?.value || types_1.DaikinOperationModes.AUTO;
|
|
47
|
-
}
|
|
12
|
+
const data_paths_1 = require("../../device/data-paths");
|
|
13
|
+
class IndoorSilentModeFeature extends on_off_data_point_feature_1.OnOffDataPointFeature {
|
|
14
|
+
spec = {
|
|
15
|
+
name: 'Indoor silent mode',
|
|
16
|
+
subtype: 'indoor_silent_mode',
|
|
17
|
+
configKey: 'showIndoorSilentMode',
|
|
18
|
+
dataPoint: 'fanControl',
|
|
19
|
+
path: data_paths_1.DataPaths.fanSpeedCurrentMode,
|
|
20
|
+
onValue: types_1.DaikinFanSpeedModes.QUIET,
|
|
21
|
+
offValue: types_1.DaikinFanSpeedModes.FIXED,
|
|
22
|
+
capability: 'hasIndoorSilentMode',
|
|
23
|
+
};
|
|
48
24
|
}
|
|
49
25
|
exports.IndoorSilentModeFeature = IndoorSilentModeFeature;
|
|
50
26
|
//# sourceMappingURL=indoor-silent-mode.feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indoor-silent-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/indoor-silent-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"indoor-silent-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/indoor-silent-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,4EAAqE;AACrE,uCAAkD;AAClD,wDAAoD;AAEpD,MAAa,uBAAwB,SAAQ,iDAAqB;IAC7C,IAAI,GAAG;QACxB,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,oBAAoB;QAC7B,SAAS,EAAE,sBAAsB;QACjC,SAAS,EAAE,YAAY;QACvB,IAAI,EAAE,sBAAS,CAAC,mBAAmB;QACnC,OAAO,EAAE,2BAAmB,CAAC,KAAK;QAClC,QAAQ,EAAE,2BAAmB,CAAC,KAAK;QACnC,UAAU,EAAE,qBAAqB;KACzB,CAAC;CACZ;AAXD,0DAWC"}
|
|
@@ -9,20 +9,19 @@
|
|
|
9
9
|
* - ON -> fanDirection vertical/horizontal currentMode = 'swing'
|
|
10
10
|
* - OFF -> fanDirection vertical/horizontal currentMode = 'stop'
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* either one keeps both in sync on the next refresh.
|
|
12
|
+
* Uses the same SwingController as the HeaterCooler's SwingMode handlers, so
|
|
13
|
+
* toggling either one keeps both in sync on the next refresh.
|
|
14
14
|
*/
|
|
15
15
|
import type { CharacteristicValue } from 'homebridge';
|
|
16
16
|
import { BaseFeature } from '../base-feature';
|
|
17
|
+
import type { FeatureConfigKey } from '../../config/config-manager';
|
|
17
18
|
export declare class OscillationModeFeature extends BaseFeature {
|
|
19
|
+
private readonly swing;
|
|
18
20
|
get featureName(): string;
|
|
19
21
|
get serviceSubtype(): string;
|
|
20
|
-
get configKey():
|
|
22
|
+
get configKey(): FeatureConfigKey;
|
|
21
23
|
isSupported(): boolean;
|
|
22
24
|
handleGet(): Promise<CharacteristicValue>;
|
|
23
25
|
handleSet(value: CharacteristicValue): Promise<void>;
|
|
24
|
-
private hasVerticalSwing;
|
|
25
|
-
private hasHorizontalSwing;
|
|
26
|
-
private getCurrentOperationMode;
|
|
27
26
|
}
|
|
28
27
|
//# sourceMappingURL=oscillation-mode.feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oscillation-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/oscillation-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"oscillation-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/oscillation-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,qBAAa,sBAAuB,SAAQ,WAAW;IACrD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkE;IAExF,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,SAAS,IAAI,gBAAgB,CAEhC;IAED,WAAW,IAAI,OAAO;IAMhB,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC;IASzC,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAS3D"}
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
* - ON -> fanDirection vertical/horizontal currentMode = 'swing'
|
|
11
11
|
* - OFF -> fanDirection vertical/horizontal currentMode = 'stop'
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* either one keeps both in sync on the next refresh.
|
|
13
|
+
* Uses the same SwingController as the HeaterCooler's SwingMode handlers, so
|
|
14
|
+
* toggling either one keeps both in sync on the next refresh.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.OscillationModeFeature = void 0;
|
|
18
18
|
const base_feature_1 = require("../base-feature");
|
|
19
|
-
const
|
|
19
|
+
const swing_controller_1 = require("../../services/climate-control/swing-controller");
|
|
20
20
|
class OscillationModeFeature extends base_feature_1.BaseFeature {
|
|
21
|
+
swing = new swing_controller_1.SwingController(() => this.device, this.managementPointId);
|
|
21
22
|
get featureName() {
|
|
22
23
|
return 'Oscillation';
|
|
23
24
|
}
|
|
@@ -28,47 +29,24 @@ class OscillationModeFeature extends base_feature_1.BaseFeature {
|
|
|
28
29
|
return 'showOscillationSwitch';
|
|
29
30
|
}
|
|
30
31
|
isSupported() {
|
|
31
|
-
const supported = this.
|
|
32
|
+
const supported = this.capabilities.hasSwingModeVertical || this.capabilities.hasSwingModeHorizontal;
|
|
32
33
|
this.log.debug(`[${this.name}] hasOscillationFeature: ${supported}`);
|
|
33
34
|
return supported;
|
|
34
35
|
}
|
|
35
36
|
async handleGet() {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
: null;
|
|
40
|
-
const horizontal = this.hasHorizontalSwing()
|
|
41
|
-
? this.getData('fanControl', `/operationModes/${operationMode}/fanDirection/horizontal/currentMode`).value
|
|
42
|
-
: null;
|
|
43
|
-
// Off only when an axis that exists is stopped — matches the HeaterCooler SwingMode logic.
|
|
44
|
-
const isOn = horizontal !== types_1.DaikinFanDirectionHorizontalModes.STOP
|
|
45
|
-
&& vertical !== types_1.DaikinFanDirectionVerticalModes.STOP;
|
|
46
|
-
this.log.debug(`[${this.name}] GET Oscillation: ${isOn} (vertical: ${vertical}, horizontal: ${horizontal}), ` +
|
|
47
|
-
`last update: ${this.accessory.context.device.getLastUpdated()}`);
|
|
37
|
+
const isOn = this.swing.isSwinging();
|
|
38
|
+
this.log.debug(`[${this.name}] GET Oscillation: ${isOn} (${this.swing.describe()}), ` +
|
|
39
|
+
`last update: ${this.device.getLastUpdated()}`);
|
|
48
40
|
return isOn;
|
|
49
41
|
}
|
|
50
42
|
async handleSet(value) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
await this.setData('fanControl', mode, `/operationModes/${operationMode}/fanDirection/horizontal/currentMode`);
|
|
56
|
-
}
|
|
57
|
-
if (this.hasVerticalSwing()) {
|
|
58
|
-
await this.setData('fanControl', mode, `/operationModes/${operationMode}/fanDirection/vertical/currentMode`);
|
|
43
|
+
const enabled = Boolean(value);
|
|
44
|
+
if (this.swing.axesToWrite(enabled).length === 0) {
|
|
45
|
+
this.log.debug(`[${this.name}] SET Oscillation skipped — already ${enabled ? 'on' : 'off'}`);
|
|
46
|
+
return;
|
|
59
47
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const data = this.getData('fanControl', `/operationModes/${this.getCurrentOperationMode()}/fanDirection/vertical/currentMode`);
|
|
63
|
-
return data?.value !== undefined;
|
|
64
|
-
}
|
|
65
|
-
hasHorizontalSwing() {
|
|
66
|
-
const data = this.getData('fanControl', `/operationModes/${this.getCurrentOperationMode()}/fanDirection/horizontal/currentMode`);
|
|
67
|
-
return data?.value !== undefined;
|
|
68
|
-
}
|
|
69
|
-
getCurrentOperationMode() {
|
|
70
|
-
const data = this.getData('operationMode');
|
|
71
|
-
return data?.value || types_1.DaikinOperationModes.AUTO;
|
|
48
|
+
this.log.debug(`[${this.name}] SET Oscillation to: ${value}`);
|
|
49
|
+
await this.write('Oscillation', () => this.swing.set(enabled));
|
|
72
50
|
}
|
|
73
51
|
}
|
|
74
52
|
exports.OscillationModeFeature = OscillationModeFeature;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oscillation-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/oscillation-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,kDAA8C;
|
|
1
|
+
{"version":3,"file":"oscillation-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/oscillation-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,kDAA8C;AAE9C,sFAAkF;AAElF,MAAa,sBAAuB,SAAQ,0BAAW;IACpC,KAAK,GAAG,IAAI,kCAAe,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAExF,IAAI,WAAW;QACb,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,WAAW;QACT,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,oBAAoB,IAAI,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC;QACrG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,4BAA4B,SAAS,EAAE,CAAC,CAAC;QACrE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ,IAAI,IAAI,CAAC,IAAI,sBAAsB,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK;YAChE,gBAAgB,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CACrD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAA0B;QACxC,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,uCAAuC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;YAC7F,OAAO;QACT,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,yBAAyB,KAAK,EAAE,CAAC,CAAC;QAC9D,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAvCD,wDAuCC"}
|
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Enables/disables the outdoor silent mode on the device.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
export declare class OutdoorSilentModeFeature extends
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
import { OnOffDataPointFeature } from '../on-off-data-point-feature';
|
|
7
|
+
import { DaikinOutdoorSilentModes } from '../../types';
|
|
8
|
+
export declare class OutdoorSilentModeFeature extends OnOffDataPointFeature {
|
|
9
|
+
protected readonly spec: {
|
|
10
|
+
readonly name: "Outdoor silent mode";
|
|
11
|
+
readonly subtype: "outdoor_silent_mode";
|
|
12
|
+
readonly configKey: "showOutdoorSilentMode";
|
|
13
|
+
readonly dataPoint: "outdoorSilentMode";
|
|
14
|
+
readonly onValue: DaikinOutdoorSilentModes.ON;
|
|
15
|
+
readonly offValue: DaikinOutdoorSilentModes.OFF;
|
|
16
|
+
readonly capability: "hasOutdoorSilentMode";
|
|
17
|
+
};
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=outdoor-silent-mode.feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outdoor-silent-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/outdoor-silent-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"outdoor-silent-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/outdoor-silent-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,qBAAa,wBAAyB,SAAQ,qBAAqB;IACjE,SAAS,CAAC,QAAQ,CAAC,IAAI;;;;;;;;MAQZ;CACZ"}
|
|
@@ -6,38 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.OutdoorSilentModeFeature = void 0;
|
|
9
|
-
const
|
|
9
|
+
const on_off_data_point_feature_1 = require("../on-off-data-point-feature");
|
|
10
10
|
const types_1 = require("../../types");
|
|
11
|
-
class OutdoorSilentModeFeature extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
isSupported() {
|
|
22
|
-
// device.getData() returns { value: undefined } when the characteristic is missing,
|
|
23
|
-
// so Boolean(data) is always true. Check the inner value to detect real support.
|
|
24
|
-
const outdoorSilentMode = this.getData('outdoorSilentMode');
|
|
25
|
-
const supported = outdoorSilentMode?.value !== undefined;
|
|
26
|
-
this.log.debug(`[${this.name}] hasOutdoorSilentModeFeature: ${supported}`);
|
|
27
|
-
return supported;
|
|
28
|
-
}
|
|
29
|
-
async handleGet() {
|
|
30
|
-
const data = this.getData('outdoorSilentMode');
|
|
31
|
-
const isOn = data?.value === types_1.DaikinOutdoorSilentModes.ON;
|
|
32
|
-
this.log.debug(`[${this.name}] GET OutdoorSilentMode: ${isOn}, ` +
|
|
33
|
-
`last update: ${this.accessory.context.device.getLastUpdated()}`);
|
|
34
|
-
return isOn;
|
|
35
|
-
}
|
|
36
|
-
async handleSet(value) {
|
|
37
|
-
this.log.debug(`[${this.name}] SET OutdoorSilentMode to: ${value}`);
|
|
38
|
-
const mode = value ? types_1.DaikinOutdoorSilentModes.ON : types_1.DaikinOutdoorSilentModes.OFF;
|
|
39
|
-
await this.setData('outdoorSilentMode', mode);
|
|
40
|
-
}
|
|
11
|
+
class OutdoorSilentModeFeature extends on_off_data_point_feature_1.OnOffDataPointFeature {
|
|
12
|
+
spec = {
|
|
13
|
+
name: 'Outdoor silent mode',
|
|
14
|
+
subtype: 'outdoor_silent_mode',
|
|
15
|
+
configKey: 'showOutdoorSilentMode',
|
|
16
|
+
dataPoint: 'outdoorSilentMode',
|
|
17
|
+
onValue: types_1.DaikinOutdoorSilentModes.ON,
|
|
18
|
+
offValue: types_1.DaikinOutdoorSilentModes.OFF,
|
|
19
|
+
capability: 'hasOutdoorSilentMode',
|
|
20
|
+
};
|
|
41
21
|
}
|
|
42
22
|
exports.OutdoorSilentModeFeature = OutdoorSilentModeFeature;
|
|
43
23
|
//# sourceMappingURL=outdoor-silent-mode.feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outdoor-silent-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/outdoor-silent-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"outdoor-silent-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/outdoor-silent-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,4EAAqE;AACrE,uCAAuD;AAEvD,MAAa,wBAAyB,SAAQ,iDAAqB;IAC9C,IAAI,GAAG;QACxB,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,uBAAuB;QAClC,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,gCAAwB,CAAC,EAAE;QACpC,QAAQ,EAAE,gCAAwB,CAAC,GAAG;QACtC,UAAU,EAAE,sBAAsB;KAC1B,CAAC;CACZ;AAVD,4DAUC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Powerful Mode Feature
|
|
3
3
|
*
|
|
4
|
-
* Enables/disables the powerful mode on the device.
|
|
4
|
+
* Enables/disables the powerful mode on the device. Used for both the
|
|
5
|
+
* climateControl and the Altherma domesticHotWaterTank management points.
|
|
5
6
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
export declare class PowerfulModeFeature extends
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { OnOffDataPointFeature } from '../on-off-data-point-feature';
|
|
8
|
+
import { DaikinPowerfulModes } from '../../types';
|
|
9
|
+
export declare class PowerfulModeFeature extends OnOffDataPointFeature {
|
|
10
|
+
protected readonly spec: {
|
|
11
|
+
readonly name: "Powerful mode";
|
|
12
|
+
readonly subtype: "powerful_mode";
|
|
13
|
+
readonly configKey: "showPowerfulMode";
|
|
14
|
+
readonly dataPoint: "powerfulMode";
|
|
15
|
+
readonly onValue: DaikinPowerfulModes.ON;
|
|
16
|
+
readonly offValue: DaikinPowerfulModes.OFF;
|
|
17
|
+
readonly capability: "hasPowerfulMode";
|
|
18
|
+
};
|
|
15
19
|
}
|
|
16
20
|
//# sourceMappingURL=powerful-mode.feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerful-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/powerful-mode.feature.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"powerful-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/powerful-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,qBAAa,mBAAoB,SAAQ,qBAAqB;IAC5D,SAAS,CAAC,QAAQ,CAAC,IAAI;;;;;;;;MAQZ;CACZ"}
|
|
@@ -2,42 +2,23 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Powerful Mode Feature
|
|
4
4
|
*
|
|
5
|
-
* Enables/disables the powerful mode on the device.
|
|
5
|
+
* Enables/disables the powerful mode on the device. Used for both the
|
|
6
|
+
* climateControl and the Altherma domesticHotWaterTank management points.
|
|
6
7
|
*/
|
|
7
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
9
|
exports.PowerfulModeFeature = void 0;
|
|
9
|
-
const
|
|
10
|
+
const on_off_data_point_feature_1 = require("../on-off-data-point-feature");
|
|
10
11
|
const types_1 = require("../../types");
|
|
11
|
-
class PowerfulModeFeature extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
isSupported() {
|
|
22
|
-
// device.getData() returns { value: undefined } when the characteristic is missing,
|
|
23
|
-
// so Boolean(data) is always true. Check the inner value to detect real support.
|
|
24
|
-
const powerfulMode = this.getData('powerfulMode');
|
|
25
|
-
const supported = powerfulMode?.value !== undefined;
|
|
26
|
-
this.log.debug(`[${this.name}] hasPowerfulModeFeature: ${supported}`);
|
|
27
|
-
return supported;
|
|
28
|
-
}
|
|
29
|
-
async handleGet() {
|
|
30
|
-
const data = this.getData('powerfulMode');
|
|
31
|
-
const isOn = data?.value === types_1.DaikinPowerfulModes.ON;
|
|
32
|
-
this.log.debug(`[${this.name}] GET PowerfulMode: ${isOn}, ` +
|
|
33
|
-
`last update: ${this.accessory.context.device.getLastUpdated()}`);
|
|
34
|
-
return isOn;
|
|
35
|
-
}
|
|
36
|
-
async handleSet(value) {
|
|
37
|
-
this.log.debug(`[${this.name}] SET PowerfulMode to: ${value}`);
|
|
38
|
-
const mode = value ? types_1.DaikinPowerfulModes.ON : types_1.DaikinPowerfulModes.OFF;
|
|
39
|
-
await this.setData('powerfulMode', mode);
|
|
40
|
-
}
|
|
12
|
+
class PowerfulModeFeature extends on_off_data_point_feature_1.OnOffDataPointFeature {
|
|
13
|
+
spec = {
|
|
14
|
+
name: 'Powerful mode',
|
|
15
|
+
subtype: 'powerful_mode',
|
|
16
|
+
configKey: 'showPowerfulMode',
|
|
17
|
+
dataPoint: 'powerfulMode',
|
|
18
|
+
onValue: types_1.DaikinPowerfulModes.ON,
|
|
19
|
+
offValue: types_1.DaikinPowerfulModes.OFF,
|
|
20
|
+
capability: 'hasPowerfulMode',
|
|
21
|
+
};
|
|
41
22
|
}
|
|
42
23
|
exports.PowerfulModeFeature = PowerfulModeFeature;
|
|
43
24
|
//# sourceMappingURL=powerful-mode.feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerful-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/powerful-mode.feature.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"powerful-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/powerful-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,4EAAqE;AACrE,uCAAkD;AAElD,MAAa,mBAAoB,SAAQ,iDAAqB;IACzC,IAAI,GAAG;QACxB,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,kBAAkB;QAC7B,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,2BAAmB,CAAC,EAAE;QAC/B,QAAQ,EAAE,2BAAmB,CAAC,GAAG;QACjC,UAAU,EAAE,iBAAiB;KACrB,CAAC;CACZ;AAVD,kDAUC"}
|
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Enables/disables the streamer mode on the device.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
export declare class StreamerModeFeature extends
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
import { OnOffDataPointFeature } from '../on-off-data-point-feature';
|
|
7
|
+
import { DaikinStreamerModes } from '../../types';
|
|
8
|
+
export declare class StreamerModeFeature extends OnOffDataPointFeature {
|
|
9
|
+
protected readonly spec: {
|
|
10
|
+
readonly name: "Streamer mode";
|
|
11
|
+
readonly subtype: "streamer_mode";
|
|
12
|
+
readonly configKey: "showStreamerMode";
|
|
13
|
+
readonly dataPoint: "streamerMode";
|
|
14
|
+
readonly onValue: DaikinStreamerModes.ON;
|
|
15
|
+
readonly offValue: DaikinStreamerModes.OFF;
|
|
16
|
+
readonly capability: "hasStreamerMode";
|
|
17
|
+
};
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=streamer-mode.feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamer-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/streamer-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"streamer-mode.feature.d.ts","sourceRoot":"","sources":["../../../../src/features/modes/streamer-mode.feature.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,qBAAa,mBAAoB,SAAQ,qBAAqB;IAC5D,SAAS,CAAC,QAAQ,CAAC,IAAI;;;;;;;;MAQZ;CACZ"}
|
|
@@ -6,38 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.StreamerModeFeature = void 0;
|
|
9
|
-
const
|
|
9
|
+
const on_off_data_point_feature_1 = require("../on-off-data-point-feature");
|
|
10
10
|
const types_1 = require("../../types");
|
|
11
|
-
class StreamerModeFeature extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
isSupported() {
|
|
22
|
-
// device.getData() returns { value: undefined } when the characteristic is missing,
|
|
23
|
-
// so Boolean(data) is always true. Check the inner value to detect real support.
|
|
24
|
-
const streamerMode = this.getData('streamerMode');
|
|
25
|
-
const supported = streamerMode?.value !== undefined;
|
|
26
|
-
this.log.debug(`[${this.name}] hasStreamerModeFeature: ${supported}`);
|
|
27
|
-
return supported;
|
|
28
|
-
}
|
|
29
|
-
async handleGet() {
|
|
30
|
-
const data = this.getData('streamerMode');
|
|
31
|
-
const isOn = data?.value === types_1.DaikinStreamerModes.ON;
|
|
32
|
-
this.log.debug(`[${this.name}] GET StreamerMode: ${isOn}, ` +
|
|
33
|
-
`last update: ${this.accessory.context.device.getLastUpdated()}`);
|
|
34
|
-
return isOn;
|
|
35
|
-
}
|
|
36
|
-
async handleSet(value) {
|
|
37
|
-
this.log.debug(`[${this.name}] SET StreamerMode to: ${value}`);
|
|
38
|
-
const mode = value ? types_1.DaikinStreamerModes.ON : types_1.DaikinStreamerModes.OFF;
|
|
39
|
-
await this.setData('streamerMode', mode);
|
|
40
|
-
}
|
|
11
|
+
class StreamerModeFeature extends on_off_data_point_feature_1.OnOffDataPointFeature {
|
|
12
|
+
spec = {
|
|
13
|
+
name: 'Streamer mode',
|
|
14
|
+
subtype: 'streamer_mode',
|
|
15
|
+
configKey: 'showStreamerMode',
|
|
16
|
+
dataPoint: 'streamerMode',
|
|
17
|
+
onValue: types_1.DaikinStreamerModes.ON,
|
|
18
|
+
offValue: types_1.DaikinStreamerModes.OFF,
|
|
19
|
+
capability: 'hasStreamerMode',
|
|
20
|
+
};
|
|
41
21
|
}
|
|
42
22
|
exports.StreamerModeFeature = StreamerModeFeature;
|
|
43
23
|
//# sourceMappingURL=streamer-mode.feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamer-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/streamer-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"streamer-mode.feature.js","sourceRoot":"","sources":["../../../../src/features/modes/streamer-mode.feature.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,4EAAqE;AACrE,uCAAkD;AAElD,MAAa,mBAAoB,SAAQ,iDAAqB;IACzC,IAAI,GAAG;QACxB,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,kBAAkB;QAC7B,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,2BAAmB,CAAC,EAAE;QAC/B,QAAQ,EAAE,2BAAmB,CAAC,GAAG;QACjC,UAAU,EAAE,iBAAiB;KACrB,CAAC;CACZ;AAVD,kDAUC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On/Off Data Point Feature
|
|
3
|
+
*
|
|
4
|
+
* Base for features that are a plain switch over one Daikin data point:
|
|
5
|
+
* ON writes `onValue`, OFF writes `offValue`, and the switch reads ON when the
|
|
6
|
+
* data point equals `onValue`. Concrete features only declare a spec.
|
|
7
|
+
*/
|
|
8
|
+
import type { CharacteristicValue } from 'homebridge';
|
|
9
|
+
import { BaseFeature } from './base-feature';
|
|
10
|
+
import type { DeviceCapabilities } from '../types';
|
|
11
|
+
import type { ExtraFeatureConfigKey } from '../config/config-manager';
|
|
12
|
+
type BooleanCapability = {
|
|
13
|
+
[K in keyof DeviceCapabilities]: DeviceCapabilities[K] extends boolean ? K : never;
|
|
14
|
+
}[keyof DeviceCapabilities];
|
|
15
|
+
export interface OnOffDataPointSpec {
|
|
16
|
+
/** Switch display name. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Un-namespaced switch subtype. */
|
|
19
|
+
subtype: string;
|
|
20
|
+
/** Per-feature config toggle, e.g. 'showPowerfulMode'. */
|
|
21
|
+
configKey: ExtraFeatureConfigKey;
|
|
22
|
+
/** Data point name, e.g. 'powerfulMode'. */
|
|
23
|
+
dataPoint: string;
|
|
24
|
+
/** Optional path inside the data point, built from the current operation mode. */
|
|
25
|
+
path?: (operationMode: string) => string;
|
|
26
|
+
onValue: string;
|
|
27
|
+
offValue: string;
|
|
28
|
+
/** Detected capability that decides isSupported(). */
|
|
29
|
+
capability: BooleanCapability;
|
|
30
|
+
}
|
|
31
|
+
export declare abstract class OnOffDataPointFeature extends BaseFeature {
|
|
32
|
+
protected abstract readonly spec: OnOffDataPointSpec;
|
|
33
|
+
get featureName(): string;
|
|
34
|
+
get serviceSubtype(): string;
|
|
35
|
+
get configKey(): ExtraFeatureConfigKey;
|
|
36
|
+
protected get legacyOwnershipDataPoint(): string | undefined;
|
|
37
|
+
isSupported(): boolean;
|
|
38
|
+
handleGet(): Promise<CharacteristicValue>;
|
|
39
|
+
handleSet(value: CharacteristicValue): Promise<void>;
|
|
40
|
+
private currentPath;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=on-off-data-point-feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-off-data-point-feature.d.ts","sourceRoot":"","sources":["../../../src/features/on-off-data-point-feature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE,KAAK,iBAAiB,GAAG;KACtB,CAAC,IAAI,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,CAAC,CAAC,SAAS,OAAO,GAAG,CAAC,GAAG,KAAK;CACnF,CAAC,MAAM,kBAAkB,CAAC,CAAC;AAE5B,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,SAAS,EAAE,qBAAqB,CAAC;IACjC,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,8BAAsB,qBAAsB,SAAQ,WAAW;IAC7D,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAErD,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,SAAS,IAAI,qBAAqB,CAErC;IAED,SAAS,KAAK,wBAAwB,IAAI,MAAM,GAAG,SAAS,CAE3D;IAED,WAAW,IAAI,OAAO;IAMhB,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAQzC,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1D,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* On/Off Data Point Feature
|
|
4
|
+
*
|
|
5
|
+
* Base for features that are a plain switch over one Daikin data point:
|
|
6
|
+
* ON writes `onValue`, OFF writes `offValue`, and the switch reads ON when the
|
|
7
|
+
* data point equals `onValue`. Concrete features only declare a spec.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.OnOffDataPointFeature = void 0;
|
|
11
|
+
const base_feature_1 = require("./base-feature");
|
|
12
|
+
const types_1 = require("../types");
|
|
13
|
+
class OnOffDataPointFeature extends base_feature_1.BaseFeature {
|
|
14
|
+
get featureName() {
|
|
15
|
+
return this.spec.name;
|
|
16
|
+
}
|
|
17
|
+
get serviceSubtype() {
|
|
18
|
+
return this.spec.subtype;
|
|
19
|
+
}
|
|
20
|
+
get configKey() {
|
|
21
|
+
return this.spec.configKey;
|
|
22
|
+
}
|
|
23
|
+
get legacyOwnershipDataPoint() {
|
|
24
|
+
return this.spec.dataPoint;
|
|
25
|
+
}
|
|
26
|
+
isSupported() {
|
|
27
|
+
const supported = this.capabilities[this.spec.capability];
|
|
28
|
+
this.log.debug(`[${this.name}] ${this.spec.capability}: ${supported}`);
|
|
29
|
+
return supported;
|
|
30
|
+
}
|
|
31
|
+
async handleGet() {
|
|
32
|
+
const isOn = this.getData(this.spec.dataPoint, this.currentPath()).value === this.spec.onValue;
|
|
33
|
+
this.log.debug(`[${this.name}] GET ${this.featureName}: ${isOn}, last update: ${this.device.getLastUpdated()}`);
|
|
34
|
+
return isOn;
|
|
35
|
+
}
|
|
36
|
+
async handleSet(value) {
|
|
37
|
+
this.log.debug(`[${this.name}] SET ${this.featureName} to: ${value}`);
|
|
38
|
+
await this.setData(this.spec.dataPoint, value ? this.spec.onValue : this.spec.offValue, this.currentPath());
|
|
39
|
+
}
|
|
40
|
+
currentPath() {
|
|
41
|
+
if (!this.spec.path) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const operationMode = this.getData('operationMode').value;
|
|
45
|
+
return this.spec.path(typeof operationMode === 'string' && operationMode ? operationMode : types_1.DaikinOperationModes.AUTO);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.OnOffDataPointFeature = OnOffDataPointFeature;
|
|
49
|
+
//# sourceMappingURL=on-off-data-point-feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-off-data-point-feature.js","sourceRoot":"","sources":["../../../src/features/on-off-data-point-feature.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,iDAA6C;AAG7C,oCAAgD;AAuBhD,MAAsB,qBAAsB,SAAQ,0BAAW;IAG7D,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;IAED,IAAc,wBAAwB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;IAC7B,CAAC;IAED,WAAW;QACT,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC,CAAC;QACvE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QAC/F,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ,IAAI,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,WAAW,KAAK,IAAI,kBAAkB,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAChG,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAA0B;QACxC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,WAAW,QAAQ,KAAK,EAAE,CAAC,CAAC;QACtE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9G,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACpB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,4BAAoB,CAAC,IAAI,CAAC,CAAC;IACxH,CAAC;CACF;AA7CD,sDA6CC"}
|