daikin-local-control 0.1.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.
Files changed (115) hide show
  1. package/DESIGN.md +98 -0
  2. package/LICENSE +674 -0
  3. package/README.md +317 -0
  4. package/UNSUPPORTED.md +43 -0
  5. package/dist/authentication.d.ts +24 -0
  6. package/dist/authentication.d.ts.map +1 -0
  7. package/dist/authentication.js +30 -0
  8. package/dist/authentication.js.map +1 -0
  9. package/dist/clients/classic.d.ts +53 -0
  10. package/dist/clients/classic.d.ts.map +1 -0
  11. package/dist/clients/classic.js +142 -0
  12. package/dist/clients/classic.js.map +1 -0
  13. package/dist/clients/client.d.ts +21 -0
  14. package/dist/clients/client.d.ts.map +1 -0
  15. package/dist/clients/client.js +2 -0
  16. package/dist/clients/client.js.map +1 -0
  17. package/dist/clients/dsiot.d.ts +28 -0
  18. package/dist/clients/dsiot.d.ts.map +1 -0
  19. package/dist/clients/dsiot.js +66 -0
  20. package/dist/clients/dsiot.js.map +1 -0
  21. package/dist/codecs/classic/capabilities.d.ts +19 -0
  22. package/dist/codecs/classic/capabilities.d.ts.map +1 -0
  23. package/dist/codecs/classic/capabilities.js +208 -0
  24. package/dist/codecs/classic/capabilities.js.map +1 -0
  25. package/dist/codecs/classic/extendedControl.d.ts +20 -0
  26. package/dist/codecs/classic/extendedControl.d.ts.map +1 -0
  27. package/dist/codecs/classic/extendedControl.js +88 -0
  28. package/dist/codecs/classic/extendedControl.js.map +1 -0
  29. package/dist/codecs/classic/keyValue.d.ts +10 -0
  30. package/dist/codecs/classic/keyValue.d.ts.map +1 -0
  31. package/dist/codecs/classic/keyValue.js +36 -0
  32. package/dist/codecs/classic/keyValue.js.map +1 -0
  33. package/dist/codecs/classic/state.d.ts +18 -0
  34. package/dist/codecs/classic/state.d.ts.map +1 -0
  35. package/dist/codecs/classic/state.js +235 -0
  36. package/dist/codecs/classic/state.js.map +1 -0
  37. package/dist/codecs/credentials.d.ts +8 -0
  38. package/dist/codecs/credentials.d.ts.map +1 -0
  39. package/dist/codecs/credentials.js +14 -0
  40. package/dist/codecs/credentials.js.map +1 -0
  41. package/dist/codecs/device.d.ts +6 -0
  42. package/dist/codecs/device.d.ts.map +1 -0
  43. package/dist/codecs/device.js +35 -0
  44. package/dist/codecs/device.js.map +1 -0
  45. package/dist/codecs/dsiot/capabilities.d.ts +5 -0
  46. package/dist/codecs/dsiot/capabilities.d.ts.map +1 -0
  47. package/dist/codecs/dsiot/capabilities.js +139 -0
  48. package/dist/codecs/dsiot/capabilities.js.map +1 -0
  49. package/dist/codecs/dsiot/multireq.d.ts +37 -0
  50. package/dist/codecs/dsiot/multireq.d.ts.map +1 -0
  51. package/dist/codecs/dsiot/multireq.js +122 -0
  52. package/dist/codecs/dsiot/multireq.js.map +1 -0
  53. package/dist/codecs/dsiot/state.d.ts +92 -0
  54. package/dist/codecs/dsiot/state.d.ts.map +1 -0
  55. package/dist/codecs/dsiot/state.js +461 -0
  56. package/dist/codecs/dsiot/state.js.map +1 -0
  57. package/dist/discovery.d.ts +17 -0
  58. package/dist/discovery.d.ts.map +1 -0
  59. package/dist/discovery.js +67 -0
  60. package/dist/discovery.js.map +1 -0
  61. package/dist/error.d.ts +15 -0
  62. package/dist/error.d.ts.map +1 -0
  63. package/dist/error.js +20 -0
  64. package/dist/error.js.map +1 -0
  65. package/dist/factory.d.ts +26 -0
  66. package/dist/factory.d.ts.map +1 -0
  67. package/dist/factory.js +31 -0
  68. package/dist/factory.js.map +1 -0
  69. package/dist/index.d.ts +22 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +21 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/models/capabilities.d.ts +42 -0
  74. package/dist/models/capabilities.d.ts.map +1 -0
  75. package/dist/models/capabilities.js +2 -0
  76. package/dist/models/capabilities.js.map +1 -0
  77. package/dist/models/device.d.ts +24 -0
  78. package/dist/models/device.d.ts.map +1 -0
  79. package/dist/models/device.js +2 -0
  80. package/dist/models/device.js.map +1 -0
  81. package/dist/models/extendedControl.d.ts +31 -0
  82. package/dist/models/extendedControl.d.ts.map +1 -0
  83. package/dist/models/extendedControl.js +7 -0
  84. package/dist/models/extendedControl.js.map +1 -0
  85. package/dist/models/state.d.ts +56 -0
  86. package/dist/models/state.d.ts.map +1 -0
  87. package/dist/models/state.js +49 -0
  88. package/dist/models/state.js.map +1 -0
  89. package/dist/transport.d.ts +75 -0
  90. package/dist/transport.d.ts.map +1 -0
  91. package/dist/transport.js +118 -0
  92. package/dist/transport.js.map +1 -0
  93. package/package.json +62 -0
  94. package/src/authentication.ts +53 -0
  95. package/src/clients/classic.ts +251 -0
  96. package/src/clients/client.ts +29 -0
  97. package/src/clients/dsiot.ts +116 -0
  98. package/src/codecs/classic/capabilities.ts +272 -0
  99. package/src/codecs/classic/extendedControl.ts +132 -0
  100. package/src/codecs/classic/keyValue.ts +39 -0
  101. package/src/codecs/classic/state.ts +302 -0
  102. package/src/codecs/credentials.ts +19 -0
  103. package/src/codecs/device.ts +41 -0
  104. package/src/codecs/dsiot/capabilities.ts +209 -0
  105. package/src/codecs/dsiot/multireq.ts +162 -0
  106. package/src/codecs/dsiot/state.ts +644 -0
  107. package/src/discovery.ts +85 -0
  108. package/src/error.ts +20 -0
  109. package/src/factory.ts +66 -0
  110. package/src/index.ts +21 -0
  111. package/src/models/capabilities.ts +52 -0
  112. package/src/models/device.ts +25 -0
  113. package/src/models/extendedControl.ts +41 -0
  114. package/src/models/state.ts +110 -0
  115. package/src/transport.ts +191 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/clients/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B;;;;2CAI2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE/C,kCAAkC;IAClC,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAEjC;mDAC+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD,iDAAiD;IACjD,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAErC,2CAA2C;IAC3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/clients/client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { type DsiotUpdate } from "../codecs/dsiot/multireq.js";
2
+ import type { DaikinCapabilities } from "../models/capabilities.js";
3
+ import type { DaikinControl, DaikinSensors, DaikinState } from "../models/state.js";
4
+ import { type DaikinRequestOptions, type DaikinRetryOptions, type DaikinTransport } from "../transport.js";
5
+ import type { DaikinClient } from "./client.js";
6
+ /** DSIOT adapter (BRP084-style). One endpoint, `/dsiot/multireq`: POST to read
7
+ * whole `dgc_status` trees, PUT to write one merged tree. */
8
+ export declare class DsiotDaikinClient implements DaikinClient {
9
+ private readonly transport;
10
+ private readonly retryOptions?;
11
+ /** `close` closes `transport`, so give each client a transport of its own. */
12
+ constructor(transport: DaikinTransport, retryOptions?: DaikinRetryOptions | undefined);
13
+ close(): Promise<void>;
14
+ getCapabilities(): Promise<DaikinCapabilities>;
15
+ getState(): Promise<DaikinState>;
16
+ setState(control: DaikinControl): Promise<void>;
17
+ getSensors(): Promise<DaikinSensors>;
18
+ /** Reboot the adapter (`/config/system/reboot`). */
19
+ reboot(): Promise<void>;
20
+ /** Raw multireq read of whole resources (`DSIOT_TARGETS` values or any `to`),
21
+ * flattened to dotted path -> value. */
22
+ multireqGet(targets: string[], options?: DaikinRequestOptions): Promise<Record<string, string>>;
23
+ /** Raw multireq write: update any leaves by dotted path, merged into one tree
24
+ * on the indoor edge. Returns the reply, flattened as `multireqGet` does. */
25
+ multireqUpdate(updates: DsiotUpdate[], options?: DaikinRequestOptions): Promise<Record<string, string>>;
26
+ private multireq;
27
+ }
28
+ //# sourceMappingURL=dsiot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dsiot.d.ts","sourceRoot":"","sources":["../../src/clients/dsiot.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAShD;6DAC6D;AAC7D,qBAAa,iBAAkB,YAAW,YAAY;IAGlD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAHhC,8EAA8E;IAC9E,YACmB,SAAS,EAAE,eAAe,EAC1B,YAAY,CAAC,EAAE,kBAAkB,YAAA,EAChD;IAEJ,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAErB;IAEK,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAOnD;IAEK,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAIrC;IAEK,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpD;IAEK,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,CAOzC;IAID,oDAAoD;IAC9C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAK5B;IAED;4CACwC;IAClC,WAAW,CACf,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAEjC;IAED;iFAC6E;IACvE,cAAc,CAClB,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAEjC;YAEa,QAAQ;CAWvB"}
@@ -0,0 +1,66 @@
1
+ import { parseDsiotCapabilities } from "../codecs/dsiot/capabilities.js";
2
+ import { buildDsiotMultireqGet, buildDsiotMultireqUpdate, DSIOT_TARGETS, parseDsiotMultireqReply, } from "../codecs/dsiot/multireq.js";
3
+ import { applyDsiotControl, parseDsiotSensors, parseDsiotState, } from "../codecs/dsiot/state.js";
4
+ import { withRetry, } from "../transport.js";
5
+ // DSIOT endpoints (BRP084-style). Climate state is a POST (read) or PUT (write)
6
+ // of a JSON property tree to `multireq`.
7
+ const DSIOT_ROUTES = {
8
+ multireq: "/dsiot/multireq",
9
+ reboot: "/config/system/reboot",
10
+ };
11
+ /** DSIOT adapter (BRP084-style). One endpoint, `/dsiot/multireq`: POST to read
12
+ * whole `dgc_status` trees, PUT to write one merged tree. */
13
+ export class DsiotDaikinClient {
14
+ transport;
15
+ retryOptions;
16
+ /** `close` closes `transport`, so give each client a transport of its own. */
17
+ constructor(transport, retryOptions) {
18
+ this.transport = transport;
19
+ this.retryOptions = retryOptions;
20
+ }
21
+ close() {
22
+ return this.transport.close();
23
+ }
24
+ async getCapabilities() {
25
+ return parseDsiotCapabilities(await this.multireqGet([
26
+ DSIOT_TARGETS.adapterInfo,
27
+ DSIOT_TARGETS.indoorStatus,
28
+ ]));
29
+ }
30
+ async getState() {
31
+ return parseDsiotState(await this.multireqGet([DSIOT_TARGETS.indoorStatus]));
32
+ }
33
+ async setState(control) {
34
+ const values = await this.multireqGet([DSIOT_TARGETS.indoorStatus]);
35
+ await this.multireqUpdate(applyDsiotControl(values, control));
36
+ }
37
+ async getSensors() {
38
+ return parseDsiotSensors(await this.multireqGet([
39
+ DSIOT_TARGETS.indoorStatus,
40
+ DSIOT_TARGETS.outdoorStatus,
41
+ ]));
42
+ }
43
+ // --- extended controls ---------------------------------------------------
44
+ /** Reboot the adapter (`/config/system/reboot`). */
45
+ async reboot() {
46
+ await this.transport.send({
47
+ method: "POST",
48
+ path: DSIOT_ROUTES.reboot,
49
+ });
50
+ }
51
+ /** Raw multireq read of whole resources (`DSIOT_TARGETS` values or any `to`),
52
+ * flattened to dotted path -> value. */
53
+ async multireqGet(targets, options) {
54
+ return this.multireq("POST", buildDsiotMultireqGet(targets), options);
55
+ }
56
+ /** Raw multireq write: update any leaves by dotted path, merged into one tree
57
+ * on the indoor edge. Returns the reply, flattened as `multireqGet` does. */
58
+ async multireqUpdate(updates, options) {
59
+ return this.multireq("PUT", buildDsiotMultireqUpdate(updates), options);
60
+ }
61
+ async multireq(method, jsonBody, { retry = true } = {}) {
62
+ const send = () => this.transport.send({ method, path: DSIOT_ROUTES.multireq, jsonBody });
63
+ return parseDsiotMultireqReply(await (retry ? withRetry(send, this.retryOptions) : send()));
64
+ }
65
+ }
66
+ //# sourceMappingURL=dsiot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dsiot.js","sourceRoot":"","sources":["../../src/clients/dsiot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EAEb,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAIL,SAAS,GACV,MAAM,iBAAiB,CAAC;AAGzB,gFAAgF;AAChF,yCAAyC;AACzC,MAAM,YAAY,GAAG;IACn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EACjB,OAA8B;QAE9B,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED;iFAC6E;IAC7E,KAAK,CAAC,cAAc,CAClB,OAAsB,EACtB,OAA8B;QAE9B,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAEO,KAAK,CAAC,QAAQ,CACpB,MAAsB,EACtB,QAAiB,EACjB,EAAE,KAAK,GAAG,IAAI,EAAE,GAAyB,EAAE;QAE3C,MAAM,IAAI,GAAG,GAAG,EAAE,CAChB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzE,OAAO,uBAAuB,CAC5B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAC5D,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import type { DaikinCapabilities } from "../../models/capabilities.js";
2
+ /** Merges the `basic_info` and `get_model_info` replies into the one field map
3
+ * `parseClassicCapabilities` and `applyClassicControl` read. Both replies
4
+ * carry a `type` (the adapter's and the unit's), so they are renamed
5
+ * to `basic_type` and `model_type` before merging; cooling-only detection
6
+ * reads `model_type`. */
7
+ export declare function mergeClassicCapabilityFields(basicInfo: Record<string, string>, modelInfo: Record<string, string>): Record<string, string>;
8
+ /** Turns the field map from `mergeClassicCapabilityFields` into
9
+ * `DaikinCapabilities`. `cpv` (capability-protocol version) is the master
10
+ * branch. Units for Japan (`reg=jp`) follow other rules, which this package
11
+ * does not model. */
12
+ export declare function parseClassicCapabilities(fields: Record<string, string>): DaikinCapabilities;
13
+ /** Whether a unit's `set_control_info` takes `shum`, read from the field map
14
+ * of `mergeClassicCapabilityFields`. A `subtype=qa` unit takes none. */
15
+ export declare function takesClassicHumidity(fields: Record<string, string>): boolean;
16
+ /** Whether a unit's `set_control_info` takes `f_dir`, read from the field map
17
+ * of `mergeClassicCapabilityFields`. */
18
+ export declare function takesClassicDirection(fields: Record<string, string>): boolean;
19
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/codecs/classic/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,8BAA8B,CAAC;AA8CtC;;;;yBAIyB;AACzB,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxB;AAED;;;qBAGqB;AACrB,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,kBAAkB,CAkCpB;AA6CD;wEACwE;AACxE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAE5E;AAoCD;wCACwC;AACxC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAY7E"}
@@ -0,0 +1,208 @@
1
+ import { FIXED_LOUVER_POSITIONS, HUMIDITY_SETTINGS, OPERATING_MODES, SWING_MODES, } from "../../models/state.js";
2
+ const CAPABILITY_VERSIONS = ["0", "1", "2", "3"];
3
+ const COOLING_ONLY_MODES = [
4
+ "cool",
5
+ "dehumidify",
6
+ "fan",
7
+ ];
8
+ const VERTICAL_SWING_MODES = ["off", "vertical"];
9
+ const ALL_FAN_LEVELS = [
10
+ "level1",
11
+ "level2",
12
+ "level3",
13
+ "level4",
14
+ "level5",
15
+ ];
16
+ const FAN_LEVELS_BY_STEPS = {
17
+ "2": ["level1", "level5"],
18
+ "3": ["level1", "level3", "level5"],
19
+ "5": ALL_FAN_LEVELS,
20
+ };
21
+ // `s_humd` is a decimal mask with one bit for each mode that takes a humidity
22
+ // setting.
23
+ const HUMIDITY_MODE_BITS = {
24
+ auto: 0x01,
25
+ cool: 0x02,
26
+ heat: 0x04,
27
+ dehumidify: 0x10,
28
+ };
29
+ // Dehumidify takes no off.
30
+ const DEHUMIDIFY_HUMIDITY_SETTINGS = HUMIDITY_SETTINGS.filter((setting) => setting !== "off");
31
+ /** Merges the `basic_info` and `get_model_info` replies into the one field map
32
+ * `parseClassicCapabilities` and `applyClassicControl` read. Both replies
33
+ * carry a `type` (the adapter's and the unit's), so they are renamed
34
+ * to `basic_type` and `model_type` before merging; cooling-only detection
35
+ * reads `model_type`. */
36
+ export function mergeClassicCapabilityFields(basicInfo, modelInfo) {
37
+ const { type: basicType, ...basic } = basicInfo;
38
+ const { type: modelType, ...model } = modelInfo;
39
+ return {
40
+ ...basic,
41
+ ...model,
42
+ ...(basicType === undefined ? {} : { basic_type: basicType }),
43
+ ...(modelType === undefined ? {} : { model_type: modelType }),
44
+ };
45
+ }
46
+ /** Turns the field map from `mergeClassicCapabilityFields` into
47
+ * `DaikinCapabilities`. `cpv` (capability-protocol version) is the master
48
+ * branch. Units for Japan (`reg=jp`) follow other rules, which this package
49
+ * does not model. */
50
+ export function parseClassicCapabilities(fields) {
51
+ const cpv = fields.cpv ?? "";
52
+ const modern = cpv === "2" || cpv === "3";
53
+ const threeD = fields.en_fdir2 === "1";
54
+ const offeredModes = modes(fields, cpv);
55
+ const offered = (mode, range) => offeredModes.includes(mode) ? range : null;
56
+ return {
57
+ modes: offeredModes,
58
+ fanSpeeds: fanSpeeds(fields, modern),
59
+ swingModes: swingModes(fields),
60
+ verticalPositions: threeD ? verticalPositions(fields) : [],
61
+ horizontalPositions: threeD ? horizontalPositions(fields) : [],
62
+ targetTemperatureInC: {
63
+ // Only `subtype=qa` units report an auto range; the rest are fixed.
64
+ auto: offered("auto", fields.subtype === "qa"
65
+ ? range(fields.hmlmt_l, 18, fields.cmlmt_h, 30)
66
+ : range(undefined, 18, undefined, 30)),
67
+ cool: offered("cool", range(fields.cmlmt_l, 18, fields.cmlmt_h, 32)),
68
+ heat: offered("heat", range(fields.hmlmt_l, 10, fields.hmlmt_h, 30)),
69
+ dehumidify: null,
70
+ fan: null,
71
+ },
72
+ targetHumidity: targetHumidity(fields, modern, offeredModes),
73
+ specialOutlet: cpv === "3" && fields.airoutlet_pv === "0",
74
+ energyMonitoring: fields.elec === "1",
75
+ demandControl: fields.adp_kind === "4" && fields.dmnd === "1",
76
+ scheduleTimer: ["1", "2"].includes(fields.en_scdltmr ?? ""),
77
+ model: fields.model,
78
+ };
79
+ }
80
+ function present(fields, key) {
81
+ return (fields[key] ?? "") !== "";
82
+ }
83
+ function modes(fields, cpv) {
84
+ if (!CAPABILITY_VERSIONS.includes(cpv)) {
85
+ return [];
86
+ }
87
+ return fields.model_type === "C"
88
+ ? OPERATING_MODES.filter((mode) => COOLING_ONLY_MODES.includes(mode))
89
+ : [...OPERATING_MODES];
90
+ }
91
+ function fanSpeeds(fields, modern) {
92
+ if (!present(fields, "reg") || fields.reg === "jp") {
93
+ return [];
94
+ }
95
+ // A `reg=th`, `subtype=qa` unit is controllable by the speeds it lists, not
96
+ // by `en_frate`.
97
+ const listsItsSpeeds = fields.reg === "th" && fields.subtype === "qa";
98
+ if (!listsItsSpeeds && fields.en_frate !== "1") {
99
+ return [];
100
+ }
101
+ const speeds = [];
102
+ if (!("en_frate_auto" in fields) || fields.en_frate_auto === "1") {
103
+ speeds.push("auto");
104
+ }
105
+ if (modern &&
106
+ (!present(fields, "en_frate_silent") || fields.en_frate_silent === "1")) {
107
+ speeds.push("silent");
108
+ }
109
+ const levels = "frate_steps" in fields
110
+ ? (FAN_LEVELS_BY_STEPS[fields.frate_steps ?? ""] ?? [])
111
+ : ALL_FAN_LEVELS;
112
+ return [...speeds, ...levels];
113
+ }
114
+ /** Whether a unit's `set_control_info` takes `shum`, read from the field map
115
+ * of `mergeClassicCapabilityFields`. A `subtype=qa` unit takes none. */
116
+ export function takesClassicHumidity(fields) {
117
+ return fields.subtype !== "qa";
118
+ }
119
+ function targetHumidity(fields, modern, offeredModes) {
120
+ const mask = modern && takesClassicHumidity(fields)
121
+ ? Number.parseInt(fields.s_humd ?? "", 10)
122
+ : 0;
123
+ const settings = (mode, values) => offeredModes.includes(mode) && mask & HUMIDITY_MODE_BITS[mode]
124
+ ? values
125
+ : [];
126
+ return {
127
+ auto: settings("auto", [...HUMIDITY_SETTINGS]),
128
+ dehumidify: settings("dehumidify", DEHUMIDIFY_HUMIDITY_SETTINGS),
129
+ cool: settings("cool", [...HUMIDITY_SETTINGS]),
130
+ heat: settings("heat", [...HUMIDITY_SETTINGS]),
131
+ fan: [],
132
+ };
133
+ }
134
+ // A unit that takes `f_dir` swings vertically only when `s_fdir=1`; a 3D unit
135
+ // without `f_dir` swings through `f_dir_ud`/`f_dir_lr` on both axes.
136
+ function swingModes(fields) {
137
+ if (takesClassicDirection(fields)) {
138
+ return fields.s_fdir === "1" ? VERTICAL_SWING_MODES : [...SWING_MODES];
139
+ }
140
+ return fields.en_fdir2 === "1" ? [...SWING_MODES] : [];
141
+ }
142
+ /** Whether a unit's `set_control_info` takes `f_dir`, read from the field map
143
+ * of `mergeClassicCapabilityFields`. */
144
+ export function takesClassicDirection(fields) {
145
+ if (!present(fields, "reg")) {
146
+ return false;
147
+ }
148
+ if (fields.subtype === "qa") {
149
+ return fields.s_fdir === "1";
150
+ }
151
+ const cpv = fields.cpv;
152
+ if (cpv === "0" || cpv === "1") {
153
+ return fields.s_fdir === "1" || fields.s_fdir === "3";
154
+ }
155
+ return (cpv === "2" || cpv === "3") && fields.en_fdir === "1";
156
+ }
157
+ // `s_fdir_ud` is a hex mask: 0x01 swing, 0x10 floor warming, 0x80 the five
158
+ // fixed positions (only when `s_fdir_ud_step=5`). Stop is offered unless a
159
+ // fixed position is.
160
+ function verticalPositions(fields) {
161
+ const stopOrSwing = ["swing", "stop"];
162
+ if (!present(fields, "s_fdir_ud")) {
163
+ return stopOrSwing;
164
+ }
165
+ const mask = Number.parseInt(fields.s_fdir_ud ?? "", 16);
166
+ if (!Number.isFinite(mask)) {
167
+ return stopOrSwing;
168
+ }
169
+ const positions = [];
170
+ if (mask & 0x01) {
171
+ positions.push("swing");
172
+ }
173
+ if (mask & 0x10) {
174
+ positions.push("floorWarming");
175
+ }
176
+ if (mask & 0x80) {
177
+ const steps = Number.parseInt(fields.s_fdir_ud_step ?? "", 10);
178
+ if (!(steps >= 0 && steps <= 5)) {
179
+ return stopOrSwing;
180
+ }
181
+ if (steps === 5) {
182
+ positions.push(...FIXED_LOUVER_POSITIONS);
183
+ }
184
+ }
185
+ if (positions.length === 0 ||
186
+ (positions.length === 1 && positions[0] === "swing")) {
187
+ positions.push("stop");
188
+ }
189
+ return positions;
190
+ }
191
+ // `s_fdir_lr` bit 0x01 is swing; stop is always offered.
192
+ function horizontalPositions(fields) {
193
+ const mask = Number.parseInt(fields.s_fdir_lr ?? "", 16);
194
+ return Number.isFinite(mask) && mask & 0x01 ? ["stop", "swing"] : ["stop"];
195
+ }
196
+ // Setpoint limits are whole °C on the wire; any fraction is dropped.
197
+ function range(low, fallbackMin, high, fallbackMax) {
198
+ return {
199
+ min: wholeCelsius(low, fallbackMin),
200
+ max: wholeCelsius(high, fallbackMax),
201
+ step: 1,
202
+ };
203
+ }
204
+ function wholeCelsius(value, fallback) {
205
+ const parsed = Number.parseFloat(value ?? "");
206
+ return Number.isFinite(parsed) ? Math.trunc(parsed) : fallback;
207
+ }
208
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/codecs/classic/capabilities.ts"],"names":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AAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { DemandControl, DeviceGroup, SpecialMode, TerminalScope } from "../../models/extendedControl.js";
2
+ export declare function encodeClassicLed(on: boolean): Record<string, string>;
3
+ export declare function encodeClassicHolidayMode(enabled: boolean): Record<string, string>;
4
+ export declare function encodeClassicDemandControl(demand: DemandControl): Record<string, string>;
5
+ export declare function encodeClassicSpecialMode(mode: SpecialMode, enabled: boolean): Record<string, string>;
6
+ /** Turns `current`, the `get_remote_method` reply, and `enabled` into the
7
+ * `set_remote_method` query. The endpoint takes the intervals back unchanged,
8
+ * so the reply's `notice_ip_int` and `notice_sync_int` are copied in. */
9
+ export declare function applyClassicOutOfHomeAccess(current: Record<string, string>, enabled: boolean): Record<string, string>;
10
+ /** Encodes the price as the `set_price` query takes it: whole units
11
+ * (`price_int`) and hundredths (`price_dec`). The price is rounded to two
12
+ * decimal places. */
13
+ export declare function encodeClassicEnergyPrice(price: number): Record<string, string>;
14
+ export declare function encodeClassicEnergyTarget(target: number): Record<string, string>;
15
+ export declare function encodeClassicName(name: string): Record<string, string>;
16
+ export declare function encodeClassicIcon(icon: string): Record<string, string>;
17
+ export declare function encodeClassicGroup(group: DeviceGroup): Record<string, string>;
18
+ export declare function encodeClassicTerminalKey(key: string): Record<string, string>;
19
+ export declare function encodeClassicTerminalScope(scope: TerminalScope): Record<string, string>;
20
+ //# sourceMappingURL=extendedControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extendedControl.d.ts","sourceRoot":"","sources":["../../../src/codecs/classic/extendedControl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,WAAW,EACX,WA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aAAa,GACnB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB"}
@@ -0,0 +1,88 @@
1
+ // Encodes each control outside `control_info` as the query its classic `set_*`
2
+ // endpoint takes.
3
+ const TERMINAL_SCOPE_CODES = {
4
+ self: "0",
5
+ others: "1",
6
+ all: "2",
7
+ };
8
+ const DEMAND_MODE_CODES = {
9
+ manual: "0",
10
+ auto: "2",
11
+ };
12
+ // `spmode_kind` on the wire; control_info's `adv` reports powerful as 2 and
13
+ // econo as 12.
14
+ const SPECIAL_MODE_KIND_CODES = {
15
+ powerful: "1",
16
+ econo: "2",
17
+ };
18
+ // `method`: the adapter is reached from outside the home network while it
19
+ // polls, and from inside only otherwise.
20
+ const REMOTE_METHOD_POLLING = "polling";
21
+ const REMOTE_METHOD_HOME_ONLY = "home only";
22
+ const REMOTE_METHOD_INTERVALS = ["notice_ip_int", "notice_sync_int"];
23
+ export function encodeClassicLed(on) {
24
+ return { led: flag(on) };
25
+ }
26
+ export function encodeClassicHolidayMode(enabled) {
27
+ return { en_hol: flag(enabled) };
28
+ }
29
+ export function encodeClassicDemandControl(demand) {
30
+ return {
31
+ demand_type: "1",
32
+ en_demand: flag(demand.enabled),
33
+ mode: DEMAND_MODE_CODES[demand.mode],
34
+ max_pow: String(demand.maxPowerInPercent),
35
+ };
36
+ }
37
+ export function encodeClassicSpecialMode(mode, enabled) {
38
+ return mode === "streamer"
39
+ ? { en_streamer: flag(enabled) }
40
+ : { set_spmode: flag(enabled), spmode_kind: SPECIAL_MODE_KIND_CODES[mode] };
41
+ }
42
+ /** Turns `current`, the `get_remote_method` reply, and `enabled` into the
43
+ * `set_remote_method` query. The endpoint takes the intervals back unchanged,
44
+ * so the reply's `notice_ip_int` and `notice_sync_int` are copied in. */
45
+ export function applyClassicOutOfHomeAccess(current, enabled) {
46
+ const query = {
47
+ method: enabled ? REMOTE_METHOD_POLLING : REMOTE_METHOD_HOME_ONLY,
48
+ };
49
+ for (const key of REMOTE_METHOD_INTERVALS) {
50
+ const value = current[key];
51
+ if (value !== undefined) {
52
+ query[key] = value;
53
+ }
54
+ }
55
+ return query;
56
+ }
57
+ /** Encodes the price as the `set_price` query takes it: whole units
58
+ * (`price_int`) and hundredths (`price_dec`). The price is rounded to two
59
+ * decimal places. */
60
+ export function encodeClassicEnergyPrice(price) {
61
+ const hundredths = Math.round(price * 100);
62
+ return {
63
+ price_int: String(Math.trunc(hundredths / 100)),
64
+ price_dec: String(hundredths % 100),
65
+ };
66
+ }
67
+ export function encodeClassicEnergyTarget(target) {
68
+ return { target: String(target) };
69
+ }
70
+ export function encodeClassicName(name) {
71
+ return { name };
72
+ }
73
+ export function encodeClassicIcon(icon) {
74
+ return { icon };
75
+ }
76
+ export function encodeClassicGroup(group) {
77
+ return { grp_name: group.name, en_grp: flag(group.enabled) };
78
+ }
79
+ export function encodeClassicTerminalKey(key) {
80
+ return { key };
81
+ }
82
+ export function encodeClassicTerminalScope(scope) {
83
+ return { type: TERMINAL_SCOPE_CODES[scope] };
84
+ }
85
+ function flag(on) {
86
+ return on ? "1" : "0";
87
+ }
88
+ //# sourceMappingURL=extendedControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extendedControl.js","sourceRoot":"","sources":["../../../src/codecs/classic/extendedControl.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,kBAAkB;AAElB,MAAM,oBAAoB,GAAkC;IAC1D,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,GAAG;CACT,CAAC;AAEF,MAAM,iBAAiB,GAA+B;IACpD,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,4EAA4E;AAC5E,eAAe;AACf,MAAM,uBAAuB,GAGzB;IACF,QAAQ,EAAE,GAAG;IACb,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,0EAA0E;AAC1E,yCAAyC;AACzC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,uBAAuB,GAAG,WA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CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;qBAEqB;AACrB,MAAM,UAAU,wBAAwB,CACtC,KAAa;IAEb,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IAC3C,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;QAC/C,SAAS,EAAE,MAAM,CAAC,UAAU,GAAG,GAAG,CAAC;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAkB;IACnD,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,KAAoB;IAEpB,OAAO,EAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,IAAI,CAAC,EAAW;IACvB,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACxB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** Splits a classic reply into its fields. A pair without `=` is dropped, and
2
+ * a value is kept as the adapter sent it, undecoded. */
3
+ export declare function parseClassicKeyValue(body: string): Record<string, string>;
4
+ export declare function isClassicOk(fields: Record<string, string>): boolean;
5
+ /** Throws a `DaikinError` unless the reply's `ret` is `OK`: status 401 for
6
+ * `AUTH NG` or `LPW NG`, 502 for anything else. Every reply carries a `ret`,
7
+ * and the adapter rejects a call with HTTP 200, so the rejection has to be
8
+ * read here rather than from the status code. */
9
+ export declare function assertClassicOk(fields: Record<string, string>): void;
10
+ //# sourceMappingURL=keyValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyValue.d.ts","sourceRoot":"","sources":["../../../src/codecs/classic/keyValue.ts"],"names":[],"mappings":"AAKA;wDACwD;AACxD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUzE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAEnE;AAED;;;iDAGiD;AACjD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAWpE"}
@@ -0,0 +1,36 @@
1
+ import { DaikinError } from "../../error.js";
2
+ // The classic CGI protocol answers a flat, comma-separated `key=value` string,
3
+ // e.g. `ret=OK,pow=1,mode=3,stemp=24,...`, and takes its writes as query parameters.
4
+ /** Splits a classic reply into its fields. A pair without `=` is dropped, and
5
+ * a value is kept as the adapter sent it, undecoded. */
6
+ export function parseClassicKeyValue(body) {
7
+ const result = {};
8
+ for (const pair of body.split(",")) {
9
+ const index = pair.indexOf("=");
10
+ if (index === -1) {
11
+ continue;
12
+ }
13
+ result[pair.slice(0, index)] = pair.slice(index + 1);
14
+ }
15
+ return result;
16
+ }
17
+ export function isClassicOk(fields) {
18
+ return fields.ret === "OK";
19
+ }
20
+ /** Throws a `DaikinError` unless the reply's `ret` is `OK`: status 401 for
21
+ * `AUTH NG` or `LPW NG`, 502 for anything else. Every reply carries a `ret`,
22
+ * and the adapter rejects a call with HTTP 200, so the rejection has to be
23
+ * read here rather than from the status code. */
24
+ export function assertClassicOk(fields) {
25
+ if (isClassicOk(fields)) {
26
+ return;
27
+ }
28
+ const ret = fields.ret;
29
+ // AUTH NG: the terminal is not registered. LPW NG: the child lock code is
30
+ // wrong.
31
+ if (ret === "AUTH NG" || ret === "LPW NG") {
32
+ throw new DaikinError(`Daikin rejected the credentials (ret=${ret})`, 401);
33
+ }
34
+ throw new DaikinError(`Daikin command failed (ret=${ret ?? "missing"})`, 502);
35
+ }
36
+ //# sourceMappingURL=keyValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyValue.js","sourceRoot":"","sources":["../../../src/codecs/classic/keyValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,+EAA+E;AAC/E,qFAAqF;AAErF;wDACwD;AACxD,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAA8B;IACxD,OAAO,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC;AAC7B,CAAC;AAED;;;iDAGiD;AACjD,MAAM,UAAU,eAAe,CAAC,MAA8B;IAC5D,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACvB,0EAA0E;IAC1E,SAAS;IACT,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1C,MAAM,IAAI,WAAW,CAAC,wCAAwC,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,IAAI,WAAW,CAAC,8BAA8B,GAAG,IAAI,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { DaikinControl, DaikinSensors, DaikinState } from "../../models/state.js";
2
+ /** Turns a `get_control_info` reply into a `DaikinState`. A `mode` or `f_rate`
3
+ * outside the model reads as `auto`, an `f_dir` outside it as `off`, and an
4
+ * `f_dir_ud` or `f_dir_lr` outside it as `null`. */
5
+ export declare function parseClassicState(fields: Record<string, string>): DaikinState;
6
+ export declare function parseClassicSensors(fields: Record<string, string>): DaikinSensors;
7
+ /** Turns `current`, the `get_control_info` reply, and a control into the
8
+ * `set_control_info` query: power and mode, the setpoint, humidity and fan
9
+ * speed for the target mode, and the airflow fields the unit takes. When the
10
+ * mode changes, each comes from the target mode's memory: `dt`, `dh`, `dfr`,
11
+ * `dfd` and, for the louvers, `ndfd`. `capabilityFields`, the field map of
12
+ * `mergeClassicCapabilityFields`, says which fields the unit takes: `shum`
13
+ * unless it is `subtype=qa`, `f_dir_ud` and `f_dir_lr` on a 3D unit
14
+ * (`en_fdir2`), and `f_dir` on a unit that takes a direction. It drops a
15
+ * `targetTemperatureInC` in dehumidify, writes `mode=0` and `mode=7` as
16
+ * `mode=1`, and never echoes `ret`, `adv` or the other modes' memory. */
17
+ export declare function applyClassicControl(current: Record<string, string>, control: DaikinControl, capabilityFields: Record<string, string>): Record<string, string>;
18
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/codecs/classic/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EAQZ,MAAM,uBAAuB,CAAC;AAwH/B;;oDAEoD;AACpD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,CAY7E;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,aAAa,CAMf;AAED;;;;;;;;;yEASyE;AACzE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,EAAE,aAAa,EACtB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiGxB"}