daikin-local-control 0.2.0 → 0.3.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/DESIGN.md +52 -0
- package/LICENSE +21 -674
- package/README.md +45 -3
- package/UNSUPPORTED.md +10 -1
- package/dist/clients/classic.d.ts +22 -4
- package/dist/clients/classic.d.ts.map +1 -1
- package/dist/clients/classic.js +55 -8
- package/dist/clients/classic.js.map +1 -1
- package/dist/clients/client.d.ts +11 -2
- package/dist/clients/client.d.ts.map +1 -1
- package/dist/clients/dsiot.d.ts +10 -3
- package/dist/clients/dsiot.d.ts.map +1 -1
- package/dist/clients/dsiot.js +40 -5
- package/dist/clients/dsiot.js.map +1 -1
- package/dist/clients/setStateCache.d.ts +15 -0
- package/dist/clients/setStateCache.d.ts.map +1 -0
- package/dist/clients/setStateCache.js +26 -0
- package/dist/clients/setStateCache.js.map +1 -0
- package/dist/codecs/classic/capabilities.d.ts.map +1 -1
- package/dist/codecs/classic/capabilities.js +28 -1
- package/dist/codecs/classic/capabilities.js.map +1 -1
- package/dist/codecs/classic/extendedControl.d.ts +14 -1
- package/dist/codecs/classic/extendedControl.d.ts.map +1 -1
- package/dist/codecs/classic/extendedControl.js +39 -4
- package/dist/codecs/classic/extendedControl.js.map +1 -1
- package/dist/codecs/classic/keyValue.d.ts +3 -0
- package/dist/codecs/classic/keyValue.d.ts.map +1 -1
- package/dist/codecs/classic/keyValue.js +10 -0
- package/dist/codecs/classic/keyValue.js.map +1 -1
- package/dist/codecs/classic/state.d.ts +3 -2
- package/dist/codecs/classic/state.d.ts.map +1 -1
- package/dist/codecs/classic/state.js +14 -1
- package/dist/codecs/classic/state.js.map +1 -1
- package/dist/codecs/device.d.ts +10 -1
- package/dist/codecs/device.d.ts.map +1 -1
- package/dist/codecs/device.js +25 -10
- package/dist/codecs/device.js.map +1 -1
- package/dist/codecs/dsiot/capabilities.d.ts +4 -2
- package/dist/codecs/dsiot/capabilities.d.ts.map +1 -1
- package/dist/codecs/dsiot/capabilities.js +20 -4
- package/dist/codecs/dsiot/capabilities.js.map +1 -1
- package/dist/codecs/dsiot/device.d.ts +5 -0
- package/dist/codecs/dsiot/device.d.ts.map +1 -0
- package/dist/codecs/dsiot/device.js +14 -0
- package/dist/codecs/dsiot/device.js.map +1 -0
- package/dist/codecs/dsiot/multireq.d.ts +6 -4
- package/dist/codecs/dsiot/multireq.d.ts.map +1 -1
- package/dist/codecs/dsiot/multireq.js +9 -4
- package/dist/codecs/dsiot/multireq.js.map +1 -1
- package/dist/codecs/dsiot/state.d.ts +6 -2
- package/dist/codecs/dsiot/state.d.ts.map +1 -1
- package/dist/codecs/dsiot/state.js +12 -2
- package/dist/codecs/dsiot/state.js.map +1 -1
- package/dist/factory.d.ts +7 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +2 -2
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/models/capabilities.d.ts +5 -1
- package/dist/models/capabilities.d.ts.map +1 -1
- package/dist/models/device.d.ts +12 -1
- package/dist/models/device.d.ts.map +1 -1
- package/dist/models/extendedControl.d.ts +2 -3
- package/dist/models/extendedControl.d.ts.map +1 -1
- package/dist/models/extendedControl.js +0 -1
- package/dist/models/extendedControl.js.map +1 -1
- package/dist/models/state.d.ts +15 -4
- package/dist/models/state.d.ts.map +1 -1
- package/dist/models/state.js +1 -0
- package/dist/models/state.js.map +1 -1
- package/package.json +2 -2
- package/src/clients/classic.ts +76 -10
- package/src/clients/client.ts +13 -1
- package/src/clients/dsiot.ts +52 -9
- package/src/clients/setStateCache.ts +28 -0
- package/src/codecs/classic/capabilities.ts +39 -0
- package/src/codecs/classic/extendedControl.ts +56 -5
- package/src/codecs/classic/keyValue.ts +10 -0
- package/src/codecs/classic/state.ts +30 -12
- package/src/codecs/device.ts +35 -10
- package/src/codecs/dsiot/capabilities.ts +27 -2
- package/src/codecs/dsiot/device.ts +20 -0
- package/src/codecs/dsiot/multireq.ts +9 -4
- package/src/codecs/dsiot/state.ts +16 -1
- package/src/factory.ts +17 -2
- package/src/index.ts +1 -0
- package/src/models/capabilities.ts +5 -0
- package/src/models/device.ts +13 -1
- package/src/models/extendedControl.ts +2 -5
- package/src/models/state.ts +18 -4
package/DESIGN.md
CHANGED
|
@@ -23,6 +23,36 @@ one that landed changes nothing. `reboot()` passes `{ retry: false }`, as should
|
|
|
23
23
|
any caller of `command()`, `multireqGet()` or `multireqUpdate()` whose request
|
|
24
24
|
is not safe to repeat.
|
|
25
25
|
|
|
26
|
+
## The read before a write
|
|
27
|
+
|
|
28
|
+
`setState` takes only the fields to change, but a write carries more than
|
|
29
|
+
those. So `setState` first reads what the unit holds, and builds the write from
|
|
30
|
+
that reply:
|
|
31
|
+
|
|
32
|
+
| Adapter | A write carries | The reply supplies |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| Classic | Every control field the unit takes, on each `set_control_info`: `pow`, `mode`, `stemp`, `shum`, `f_rate` and the direction fields. Whether the adapter takes a request without one of them is not known, so none is left out. | Each field the control leaves out. On a mode change, the values the adapter remembers for the target mode: `dt3`, `dh3`, `dfr3` and `dfd3` for cool. |
|
|
35
|
+
| DSIOT | The power, the power transition and the mode on each write, then only the leaves the control changes | The power the unit holds, which decides the transition. The mode, when the control sets none. The `md` of the louver and humidity leaves, which a position and a percentage are encoded from. |
|
|
36
|
+
|
|
37
|
+
With `maxStateAgeForSetStateInMs` set, `setState` skips that read while the
|
|
38
|
+
client's `SetStateCache` holds a reply to `getState` or `getStateAndSensors`
|
|
39
|
+
younger than that. A caller that polls sets it to its poll interval, and a
|
|
40
|
+
write then costs one request where it cost two. No read is answered from the
|
|
41
|
+
cache: `getState` asks the unit every time.
|
|
42
|
+
|
|
43
|
+
The default is 0, because a write built from an old reply undoes a change made
|
|
44
|
+
on the remote control since that reply. Someone switches the unit to heat on
|
|
45
|
+
the remote, the caller sets 23 °C from a reply read before that, and the write
|
|
46
|
+
puts the unit back in cool.
|
|
47
|
+
|
|
48
|
+
Every write through the client clears the cache, `command()` with parameters
|
|
49
|
+
and `multireqUpdate()` included, so the `setState` after a write reads first.
|
|
50
|
+
|
|
51
|
+
Rejected: `setState` taking a whole `DaikinState` from the caller in place of
|
|
52
|
+
the read. A `DaikinState` holds the current mode's values alone: it has neither
|
|
53
|
+
the values a classic adapter remembers for the other modes nor the `md` of a
|
|
54
|
+
DSIOT leaf, so the client would still need the reply.
|
|
55
|
+
|
|
26
56
|
## Capabilities
|
|
27
57
|
|
|
28
58
|
`DaikinCapabilities` lists what a unit accepts in the vocabulary of `DaikinState`:
|
|
@@ -96,3 +126,25 @@ Rejected: positions as the numbers 0 to 25, typed `number`, with
|
|
|
96
126
|
- A caller learned of a mistyped number only when the call ran.
|
|
97
127
|
- The `Error` was the one failure of `setState` that was not a
|
|
98
128
|
`DaikinError`.
|
|
129
|
+
|
|
130
|
+
## Special modes
|
|
131
|
+
|
|
132
|
+
`DaikinState.specialModes` lists the special modes that are on, and `getState`
|
|
133
|
+
reads it on both protocols. `DaikinControl` leaves it out, so `setState` is
|
|
134
|
+
never handed a field it cannot write: UNSUPPORTED.md says what is not known.
|
|
135
|
+
|
|
136
|
+
Rejected: a `getSpecialModes` on `ClassicDaikinClient`, beside `setSpecialMode`.
|
|
137
|
+
|
|
138
|
+
- A classic adapter reports the modes in `adv`, in the `get_control_info` reply
|
|
139
|
+
`getState` already reads, so the method sent a second request for a reply the
|
|
140
|
+
caller had.
|
|
141
|
+
- A DSIOT adapter reports them in its `dgc_status` trees, and a method on
|
|
142
|
+
`ClassicDaikinClient` gave a caller no way to read those.
|
|
143
|
+
|
|
144
|
+
`DaikinCapabilities.specialModes` lists the special modes a unit takes mode by
|
|
145
|
+
mode, as `targetHumidities` does.
|
|
146
|
+
|
|
147
|
+
Rejected: one list for the whole unit.
|
|
148
|
+
|
|
149
|
+
- Econo is not known to be taken in fan mode, so the one list offered it in a
|
|
150
|
+
mode where UNSUPPORTED.md lists it as unknown.
|