homebridge-easy-mqtt 1.3.0-beta.6 → 1.4.0-beta.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/CHANGELOG.md +16 -12
- package/README.md +59 -28
- package/config.schema.json +294 -3
- package/dist/accessory/abstract/base.js +10 -8
- package/dist/accessory/abstract/base.js.map +1 -1
- package/dist/accessory/abstract/helper.js +4 -1
- package/dist/accessory/abstract/helper.js.map +1 -1
- package/dist/accessory/climate/climate.d.ts +12 -0
- package/dist/accessory/climate/climate.js +31 -0
- package/dist/accessory/climate/climate.js.map +1 -0
- package/dist/accessory/climate/heaterCooler.d.ts +23 -0
- package/dist/accessory/climate/heaterCooler.js +157 -0
- package/dist/accessory/climate/heaterCooler.js.map +1 -0
- package/dist/accessory/{thermostat.d.ts → climate/thermostat.d.ts} +5 -8
- package/dist/accessory/{thermostat.js → climate/thermostat.js} +4 -24
- package/dist/accessory/climate/thermostat.js.map +1 -0
- package/dist/accessory/security.js +2 -2
- package/dist/accessory/security.js.map +1 -1
- package/dist/accessory/sensor/carbonDioxide.js +1 -1
- package/dist/accessory/sensor/carbonDioxide.js.map +1 -1
- package/dist/accessory/sensor/carbonMonoxide.js +1 -1
- package/dist/accessory/sensor/carbonMonoxide.js.map +1 -1
- package/dist/accessory/sensor/contact.js +1 -1
- package/dist/accessory/sensor/contact.js.map +1 -1
- package/dist/accessory/sensor/humidity.js.map +1 -1
- package/dist/accessory/sensor/leak.js +1 -1
- package/dist/accessory/sensor/leak.js.map +1 -1
- package/dist/accessory/sensor/motion.js +1 -1
- package/dist/accessory/sensor/motion.js.map +1 -1
- package/dist/accessory/sensor/occupancy.js +1 -1
- package/dist/accessory/sensor/occupancy.js.map +1 -1
- package/dist/accessory/sensor/sensor.js +2 -2
- package/dist/accessory/sensor/sensor.js.map +1 -1
- package/dist/accessory/sensor/smoke.js +1 -1
- package/dist/accessory/sensor/smoke.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +1 -1
- package/dist/homebridge-ui/public/ui.js +1 -1
- package/dist/i18n/en.d.ts +51 -4
- package/dist/i18n/en.js +51 -4
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.d.ts +55 -8
- package/dist/i18n/fr.js +4 -4
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/i18n.d.ts +51 -4
- package/dist/i18n/template.d.ts +51 -4
- package/dist/model/enums.d.ts +7 -0
- package/dist/model/enums.js +7 -0
- package/dist/model/enums.js.map +1 -1
- package/dist/model/types.d.ts +45 -19
- package/package.json +1 -1
- package/dist/accessory/thermostat.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to homebridge-dummy will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 1.
|
|
5
|
+
## 1.4.0-beta.0 (2025-09-XX)
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
- Support for HeaterCooler
|
|
9
|
+
|
|
10
|
+
### Notes
|
|
11
|
+
Would you like to see Homebridge Easy MQTT in your language? Please consider [getting involved](https://github.com/mpatfield/homebridge-easy-mqtt/issues/4). No coding experience required!
|
|
12
|
+
|
|
13
|
+
## 1.3.0 (2025-09-14)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Support for Thermostats
|
|
17
|
+
- Support CO, CO2, Contact, Humidity, Leak, Motion, Occupancy, and Smoke sensors
|
|
18
|
+
- Support for Groups allowing you to combine multiple accessories into one
|
|
19
|
+
- ⚠️ Note that changing the group name will require you to reconfigure any HomeKit scenes/automations for those accessories
|
|
20
|
+
- Support for arbitrary custom characteristics ([documentation](https://github.com/mpatfield/homebridge-easy-mqtt#custom-characteristics))
|
|
13
21
|
- JSONPath support in setter topics ([documentation](https://github.com/mpatfield/homebridge-easy-mqtt#jsonpaths))
|
|
14
|
-
- Traductions en Français
|
|
15
|
-
-
|
|
22
|
+
- Traductions en Français - Merci, [@7ute](https://github.com/sponsors/7ute)!!
|
|
23
|
+
- Show banner image in config UI
|
|
16
24
|
|
|
17
25
|
### Changed
|
|
18
26
|
- Significant under-the-hood cleanup to speed future development
|
|
@@ -20,10 +28,6 @@ All notable changes to homebridge-dummy will be documented in this file.
|
|
|
20
28
|
### Fixed
|
|
21
29
|
- Exponential backoff for MQTT connection errors
|
|
22
30
|
|
|
23
|
-
### Notes
|
|
24
|
-
|
|
25
|
-
• Would you like to see Homebridge Easy MQTT in your language? Please consider [getting involved](https://github.com/mpatfield/homebridge-easy-mqtt/issues/4). No coding experience required!
|
|
26
|
-
|
|
27
31
|
## 1.2.0 (2025-09-02)
|
|
28
32
|
|
|
29
33
|
### Added
|
package/README.md
CHANGED
|
@@ -185,6 +185,52 @@ As with topics, you will also need to populate the appropriate values based on t
|
|
|
185
185
|
- `topicGetCurrentTemperature*` - The current temperature of the sensor
|
|
186
186
|
- `temperatureUnits` - The temperature units of the incoming value supplied by the sensor, `C` for Celsius (default) `F` for Fahrenheit
|
|
187
187
|
|
|
188
|
+
### Climate Controllers
|
|
189
|
+
- `temperatureUnits` - The temperature units of the incoming value supplied by the thermostat, `C` for Celsius (default) `F` for Fahrenheit
|
|
190
|
+
- `topicGetCoolingThresholdTemperature` - Get the cooling threshold temperature
|
|
191
|
+
- `topicSetCoolingThresholdTemperature` - Set the cooling threshold temparture
|
|
192
|
+
- `topicGetHeatingThresholdTemperature` - Get the heating threshold temperature
|
|
193
|
+
- `topicSetHeatingThresholdTemperature` - Set the heating threshold temperature
|
|
194
|
+
|
|
195
|
+
#### HeaterCooler
|
|
196
|
+
- `topicGetActive*` - Get whether or not the accessory is currently active
|
|
197
|
+
- `topicSetActive*` - Set whether or not the accessory is currently active
|
|
198
|
+
- `topicGetCurrentHeaterCoolerState*` - Get the current mode (i.e. inactive, idle, heating, cooling)
|
|
199
|
+
- `topicGetTargetHeaterCoolerState*` - Get the target mode (i.e. auto, heat, cool)
|
|
200
|
+
- `topicSetTargetHeaterCoolerState*` - Set the target mode (i.e. auto, heat, cool)
|
|
201
|
+
- `topicGetLockPhysicalControls` - Get whether or not the physical controls are locked
|
|
202
|
+
- `topicSetLockPhysicalControls` - Set whether or not the physical controls are locked
|
|
203
|
+
- `topicGetRotationSpeed` - Get the rotation speed as a percentage
|
|
204
|
+
- `topicSetRotationSpeed` - Set the rotation speed as a percentage
|
|
205
|
+
- `topicGetSwingMode` - Get whether or not accessory is oscillating
|
|
206
|
+
- `topicSetSwingMode` - Set whether or not accessory is oscillating
|
|
207
|
+
- `valueStateActive*` - Accessory is currently active
|
|
208
|
+
- `valueStateInactive*` - Accessory is currently inactive
|
|
209
|
+
- `valueModeAuto` - Mode is auto
|
|
210
|
+
- `valueModeCool` - Mode is cool/cooling
|
|
211
|
+
- `valueModeHeat` - Mode is heat/heating
|
|
212
|
+
- `valueModeIdle` - Mode is idle
|
|
213
|
+
- `valueModeInactive` - Mode is inactive
|
|
214
|
+
- `valueControlLock` - Physical controls are locked
|
|
215
|
+
- `valueControlUnlock` - Physical controls are unlocked
|
|
216
|
+
- `valueSwingEnabled` - Accessory is oscillating
|
|
217
|
+
- `valueSwingDisabled` - Accessory is not oscillating
|
|
218
|
+
|
|
219
|
+
#### Thermostat
|
|
220
|
+
- `topicGetCurrentHeatingCoolingState*` - Get the current mode (i.e. cooling, heating, off)
|
|
221
|
+
- `topicGetTargetHeatingCoolingState*` - Get the target mode (i.e. auto, cooling, heating, off)
|
|
222
|
+
- `topicSetTargetHeatingCoolingState*` - Set the target mode (i.e. auto, cooling, heating, off)
|
|
223
|
+
- `topicGetCurrentTemperature*` - Get the current temperature
|
|
224
|
+
- `topicGetTargetTemperature*` - Get the target temperature
|
|
225
|
+
- `topicSetTargetTemperature*` - Set the target temperature
|
|
226
|
+
- `topicGetCurrentRelativeHumidity` - Get the current humidity
|
|
227
|
+
- `topicGetTargetRelativeHumidity` - Get the target humidity
|
|
228
|
+
- `topicSetTargetRelativeHumidity` - Set the target humidity
|
|
229
|
+
- `valueModeAuto` - Auto mode
|
|
230
|
+
- `valueModeCool` - Cool mode
|
|
231
|
+
- `valueModeHeat` - Heat mode
|
|
232
|
+
- `valueModeOff` - Thermostat off
|
|
233
|
+
|
|
188
234
|
### Others
|
|
189
235
|
|
|
190
236
|
#### LockMechanism
|
|
@@ -209,26 +255,6 @@ As with topics, you will also need to populate the appropriate values based on t
|
|
|
209
255
|
- `valueFault` - Accessory has a fault
|
|
210
256
|
- `valueTampered` - Accessory has been tampered with
|
|
211
257
|
|
|
212
|
-
### Thermostat
|
|
213
|
-
- `temperatureUnits` - The temperature units of the incoming value supplied by the thermostat, `C` for Celsius (default) `F` for Fahrenheit
|
|
214
|
-
- `topicGetCurrentHeatingCoolingState*` - Get the current mode (i.e. cooling, heating, off)
|
|
215
|
-
- `topicGetTargetHeatingCoolingState*` - Get the target mode (i.e. auto, cooling, heating, off)
|
|
216
|
-
- `topicSetTargetHeatingCoolingState*` - Set the target mode (i.e. auto, cooling, heating, off)
|
|
217
|
-
- `topicGetCurrentTemperature*` - Get the current temperature
|
|
218
|
-
- `topicGetTargetTemperature*` - Get the target temperature
|
|
219
|
-
- `topicSetTargetTemperature*` - Set the target temperature
|
|
220
|
-
- `topicGetCurrentRelativeHumidity` - Get the current humidity
|
|
221
|
-
- `topicGetTargetRelativeHumidity` - Get the target humidity
|
|
222
|
-
- `topicSetTargetRelativeHumidity` - Set the target humidity
|
|
223
|
-
- `topicGetCoolingThresholdTemperature` - Get the cooling threshold temperature
|
|
224
|
-
- `topicSetCoolingThresholdTemperature` - Set the cooling threshold temparture
|
|
225
|
-
- `topicGetHeatingThresholdTemperature` - Get the heating threshold temperature
|
|
226
|
-
- `topicSetHeatingThresholdTemperature` - Set the heating threshold temperature
|
|
227
|
-
- `valueModeAuto` - Auto mode
|
|
228
|
-
- `valueModeCool` - Cool mode
|
|
229
|
-
- `valueModeHeat` - Heat mode
|
|
230
|
-
- `valueModeOff` - Thermostat off
|
|
231
|
-
|
|
232
258
|
## Logging/Debugging:
|
|
233
259
|
|
|
234
260
|
By default, devices will log activity, for example when a Switch is turned on or a LockMechanism is unlocked.
|
|
@@ -323,14 +349,19 @@ If you use a more advanced HomeKit app like [Eve](https://apps.apple.com/us/app/
|
|
|
323
349
|
Due to the complexity, this was intentionally left out of the plugin config UI, so this can only be configured manually.
|
|
324
350
|
|
|
325
351
|
```json
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
352
|
+
{
|
|
353
|
+
"info": …
|
|
354
|
+
"mqtt": …
|
|
355
|
+
"customCharacteristics": [
|
|
356
|
+
{
|
|
357
|
+
"uuid": "string",
|
|
358
|
+
"name": "string",
|
|
359
|
+
"getTopic": "string",
|
|
360
|
+
"units": "string",
|
|
361
|
+
}
|
|
362
|
+
… // Topic & Values
|
|
363
|
+
],
|
|
364
|
+
}
|
|
334
365
|
```
|
|
335
366
|
|
|
336
367
|
- `uuid` — A unique string (recommend using a (UUID generator)[https://www.uuidgenerator.net/])
|
package/config.schema.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"type": {
|
|
22
22
|
"type": "string",
|
|
23
23
|
"title": "${config.title.type}",
|
|
24
|
-
"enum": [ "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "HumiditySensor", "LeakSensor", "Lightbulb", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat"],
|
|
25
|
-
"enumNames": ["${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${config.enumNames.lockMechanism}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.smokeSensor}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}", "${config.enumNames.thermostat}"],
|
|
24
|
+
"enum": [ "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "HeaterCooler", "HumiditySensor", "LeakSensor", "Lightbulb", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat"],
|
|
25
|
+
"enumNames": ["${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.heaterCooler}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${config.enumNames.lockMechanism}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.smokeSensor}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}", "${config.enumNames.thermostat}"],
|
|
26
26
|
"required": true
|
|
27
27
|
},
|
|
28
28
|
"group": {
|
|
@@ -295,6 +295,50 @@
|
|
|
295
295
|
"type": "string",
|
|
296
296
|
"title": "${config.title.topicSetHeatingThresholdTemperature}"
|
|
297
297
|
},
|
|
298
|
+
"topicGetActive": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"title": "${config.title.topicGetActive}"
|
|
301
|
+
},
|
|
302
|
+
"topicGetCurrentHeaterCoolerState": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"title": "${config.title.topicGetCurrentHeaterCoolerState}"
|
|
305
|
+
},
|
|
306
|
+
"topicGetLockPhysicalControls": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"title": "${config.title.topicGetLockPhysicalControls}"
|
|
309
|
+
},
|
|
310
|
+
"topicGetRotationSpeed": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"title": "${config.title.topicGetRotationSpeed}"
|
|
313
|
+
},
|
|
314
|
+
"topicGetSwingMode": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"title": "${config.title.topicGetSwingMode}"
|
|
317
|
+
},
|
|
318
|
+
"topicGetTargetHeaterCoolerState": {
|
|
319
|
+
"type": "string",
|
|
320
|
+
"title": "${config.title.topicGetTargetHeaterCoolerState}"
|
|
321
|
+
},
|
|
322
|
+
"topicSetActive": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"title": "${config.title.topicSetActive}"
|
|
325
|
+
},
|
|
326
|
+
"topicSetLockPhysicalControls": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"title": "${config.title.topicSetLockPhysicalControls}"
|
|
329
|
+
},
|
|
330
|
+
"topicSetRotationSpeed": {
|
|
331
|
+
"type": "string",
|
|
332
|
+
"title": "${config.title.topicSetRotationSpeed}"
|
|
333
|
+
},
|
|
334
|
+
"topicSetSwingMode": {
|
|
335
|
+
"type": "string",
|
|
336
|
+
"title": "${config.title.topicSetSwingMode}"
|
|
337
|
+
},
|
|
338
|
+
"topicSetTargetHeaterCoolerState": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"title": "${config.title.topicSetTargetHeaterCoolerState}"
|
|
341
|
+
},
|
|
298
342
|
"valueBatteryLow": {
|
|
299
343
|
"type": "string",
|
|
300
344
|
"title": "${config.title.valueBatteryLow}"
|
|
@@ -399,6 +443,38 @@
|
|
|
399
443
|
"type": "string",
|
|
400
444
|
"title": "${config.title.valueModeOff}"
|
|
401
445
|
},
|
|
446
|
+
"valueControlLock": {
|
|
447
|
+
"type": "string",
|
|
448
|
+
"title": "${config.title.valueControlLock}"
|
|
449
|
+
},
|
|
450
|
+
"valueControlUnlock": {
|
|
451
|
+
"type": "string",
|
|
452
|
+
"title": "${config.title.valueControlUnlock}"
|
|
453
|
+
},
|
|
454
|
+
"valueModeIdle": {
|
|
455
|
+
"type": "string",
|
|
456
|
+
"title": "${config.title.valueModeIdle}"
|
|
457
|
+
},
|
|
458
|
+
"valueModeInactive": {
|
|
459
|
+
"type": "string",
|
|
460
|
+
"title": "${config.title.valueModeInactive}"
|
|
461
|
+
},
|
|
462
|
+
"valueStateActive": {
|
|
463
|
+
"type": "string",
|
|
464
|
+
"title": "${config.title.valueStateActive}"
|
|
465
|
+
},
|
|
466
|
+
"valueStateInactive": {
|
|
467
|
+
"type": "string",
|
|
468
|
+
"title": "${config.title.valueStateInactive}"
|
|
469
|
+
},
|
|
470
|
+
"valueSwingEnabled": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"title": "${config.title.valueSwingEnabled}"
|
|
473
|
+
},
|
|
474
|
+
"valueSwingDisabled": {
|
|
475
|
+
"type": "string",
|
|
476
|
+
"title": "${config.title.valueSwingDisabled}"
|
|
477
|
+
},
|
|
402
478
|
"disableLogging": {
|
|
403
479
|
"type": "boolean",
|
|
404
480
|
"title": "${config.title.disableLogging}"
|
|
@@ -747,6 +823,147 @@
|
|
|
747
823
|
}
|
|
748
824
|
]
|
|
749
825
|
},
|
|
826
|
+
{
|
|
827
|
+
"type": "fieldset",
|
|
828
|
+
"notitle": true,
|
|
829
|
+
"condition": {
|
|
830
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'HeaterCooler';"
|
|
831
|
+
},
|
|
832
|
+
"items": [
|
|
833
|
+
{
|
|
834
|
+
"type": "div",
|
|
835
|
+
"displayFlex": true,
|
|
836
|
+
"flex-direction": "row",
|
|
837
|
+
"items": [
|
|
838
|
+
{
|
|
839
|
+
"key": "accessories[].topicGetCurrentTemperature",
|
|
840
|
+
"flex": "0 0 50%"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"key": "accessories[].temperatureUnits",
|
|
844
|
+
"title": "${config.title.sourceUnits}",
|
|
845
|
+
"flex": "0 0 25%"
|
|
846
|
+
}
|
|
847
|
+
]
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"type": "div",
|
|
851
|
+
"displayFlex": true,
|
|
852
|
+
"flex-direction": "row",
|
|
853
|
+
"items": [
|
|
854
|
+
{
|
|
855
|
+
"key": "accessories[].topicGetActive",
|
|
856
|
+
"flex": "0 0 50%"
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"key": "accessories[].topicSetActive",
|
|
860
|
+
"flex": "0 0 50%"
|
|
861
|
+
}
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"type": "div",
|
|
866
|
+
"displayFlex": true,
|
|
867
|
+
"flex-direction": "row",
|
|
868
|
+
"items": [
|
|
869
|
+
{
|
|
870
|
+
"key": "accessories[].topicGetCurrentHeaterCoolerState",
|
|
871
|
+
"flex": "0 0 50%"
|
|
872
|
+
}
|
|
873
|
+
]
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"type": "div",
|
|
877
|
+
"displayFlex": true,
|
|
878
|
+
"flex-direction": "row",
|
|
879
|
+
"items": [
|
|
880
|
+
{
|
|
881
|
+
"key": "accessories[].topicGetTargetHeaterCoolerState",
|
|
882
|
+
"flex": "0 0 50%"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"key": "accessories[].topicSetTargetHeaterCoolerState",
|
|
886
|
+
"flex": "0 0 50%"
|
|
887
|
+
}
|
|
888
|
+
]
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"type": "div",
|
|
892
|
+
"displayFlex": true,
|
|
893
|
+
"flex-direction": "row",
|
|
894
|
+
"items": [
|
|
895
|
+
{
|
|
896
|
+
"key": "accessories[].topicGetCoolingThresholdTemperature",
|
|
897
|
+
"flex": "0 0 50%"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
"key": "accessories[].topicSetCoolingThresholdTemperature",
|
|
901
|
+
"flex": "0 0 50%"
|
|
902
|
+
}
|
|
903
|
+
]
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"type": "div",
|
|
907
|
+
"displayFlex": true,
|
|
908
|
+
"flex-direction": "row",
|
|
909
|
+
"items": [
|
|
910
|
+
{
|
|
911
|
+
"key": "accessories[].topicGetHeatingThresholdTemperature",
|
|
912
|
+
"flex": "0 0 50%"
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
"key": "accessories[].topicSetHeatingThresholdTemperature",
|
|
916
|
+
"flex": "0 0 50%"
|
|
917
|
+
}
|
|
918
|
+
]
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
"type": "div",
|
|
922
|
+
"displayFlex": true,
|
|
923
|
+
"flex-direction": "row",
|
|
924
|
+
"items": [
|
|
925
|
+
{
|
|
926
|
+
"key": "accessories[].topicGetLockPhysicalControls",
|
|
927
|
+
"flex": "0 0 50%"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"key": "accessories[].topicSetLockPhysicalControls",
|
|
931
|
+
"flex": "0 0 50%"
|
|
932
|
+
}
|
|
933
|
+
]
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"type": "div",
|
|
937
|
+
"displayFlex": true,
|
|
938
|
+
"flex-direction": "row",
|
|
939
|
+
"items": [
|
|
940
|
+
{
|
|
941
|
+
"key": "accessories[].topicGetRotationSpeed",
|
|
942
|
+
"flex": "0 0 50%"
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
"key": "accessories[].topicSetRotationSpeed",
|
|
946
|
+
"flex": "0 0 50%"
|
|
947
|
+
}
|
|
948
|
+
]
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"type": "div",
|
|
952
|
+
"displayFlex": true,
|
|
953
|
+
"flex-direction": "row",
|
|
954
|
+
"items": [
|
|
955
|
+
{
|
|
956
|
+
"key": "accessories[].topicGetSwingMode",
|
|
957
|
+
"flex": "0 0 50%"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"key": "accessories[].topicSetSwingMode",
|
|
961
|
+
"flex": "0 0 50%"
|
|
962
|
+
}
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
]
|
|
966
|
+
},
|
|
750
967
|
{
|
|
751
968
|
"type": "div",
|
|
752
969
|
"displayFlex": true,
|
|
@@ -881,7 +1098,7 @@
|
|
|
881
1098
|
{
|
|
882
1099
|
"key": "accessories[].temperatureUnits",
|
|
883
1100
|
"title": "${config.title.sourceUnits}",
|
|
884
|
-
"flex": "0 0
|
|
1101
|
+
"flex": "0 0 25%"
|
|
885
1102
|
}
|
|
886
1103
|
]
|
|
887
1104
|
},
|
|
@@ -1012,6 +1229,80 @@
|
|
|
1012
1229
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type !== undefined;"
|
|
1013
1230
|
},
|
|
1014
1231
|
"items": [
|
|
1232
|
+
{
|
|
1233
|
+
"type": "fieldset",
|
|
1234
|
+
"notitle": true,
|
|
1235
|
+
"condition": {
|
|
1236
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'HeaterCooler';"
|
|
1237
|
+
},
|
|
1238
|
+
"items": [
|
|
1239
|
+
{
|
|
1240
|
+
"type": "div",
|
|
1241
|
+
"displayFlex": true,
|
|
1242
|
+
"flex-direction": "row",
|
|
1243
|
+
"items": [
|
|
1244
|
+
{
|
|
1245
|
+
"key": "accessories[].valueStateActive",
|
|
1246
|
+
"flex": "0 0 20%"
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
"key": "accessories[].valueStateInactive",
|
|
1250
|
+
"flex": "0 0 20%"
|
|
1251
|
+
}
|
|
1252
|
+
]
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
"type": "div",
|
|
1256
|
+
"displayFlex": true,
|
|
1257
|
+
"flex-direction": "row",
|
|
1258
|
+
"items": [
|
|
1259
|
+
{
|
|
1260
|
+
"key": "accessories[].valueModeAuto",
|
|
1261
|
+
"flex": "0 0 20%"
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
"key": "accessories[].valueModeCool",
|
|
1265
|
+
"flex": "0 0 20%"
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
"key": "accessories[].valueModeHeat",
|
|
1269
|
+
"flex": "0 0 20%"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
"key": "accessories[].valueModeIdle",
|
|
1273
|
+
"flex": "0 0 20%"
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
"key": "accessories[].valueModeInactive",
|
|
1277
|
+
"flex": "0 0 20%"
|
|
1278
|
+
}
|
|
1279
|
+
]
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
"type": "div",
|
|
1283
|
+
"displayFlex": true,
|
|
1284
|
+
"flex-direction": "row",
|
|
1285
|
+
"items": [
|
|
1286
|
+
{
|
|
1287
|
+
"key": "accessories[].valueControlLock",
|
|
1288
|
+
"flex": "0 0 20%"
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
"key": "accessories[].valueControlUnlock",
|
|
1292
|
+
"flex": "0 0 20%"
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
"key": "accessories[].valueSwingEnabled",
|
|
1296
|
+
"flex": "0 0 20%"
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
"key": "accessories[].valueSwingDisabled",
|
|
1300
|
+
"flex": "0 0 20%"
|
|
1301
|
+
}
|
|
1302
|
+
]
|
|
1303
|
+
}
|
|
1304
|
+
]
|
|
1305
|
+
},
|
|
1015
1306
|
{
|
|
1016
1307
|
"type": "div",
|
|
1017
1308
|
"displayFlex": true,
|
|
@@ -7,15 +7,17 @@ import getVersion from '../../tools/version.js';
|
|
|
7
7
|
export class BaseAccessory extends MQTTAccessory {
|
|
8
8
|
constructor(Service, Characteristic, accessory, config, log, isGrouped) {
|
|
9
9
|
super(Service, Characteristic, accessory, config, log, isGrouped);
|
|
10
|
-
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
if (!isGrouped) {
|
|
11
|
+
accessory.getService(Service.AccessoryInformation)
|
|
12
|
+
.setCharacteristic(Characteristic.Name, config.info.name)
|
|
13
|
+
.setCharacteristic(Characteristic.ConfiguredName, config.info.name)
|
|
14
|
+
.setCharacteristic(Characteristic.Manufacturer, config.info.manufacturer ?? PLATFORM_NAME)
|
|
15
|
+
.setCharacteristic(Characteristic.Model, config.info.model ?? config.info.type)
|
|
16
|
+
.setCharacteristic(Characteristic.SerialNumber, config.info.serialNumber ?? config.info.id)
|
|
17
|
+
.setCharacteristic(Characteristic.FirmwareRevision, config.info.version ?? getVersion());
|
|
18
|
+
}
|
|
17
19
|
this.setupCharacteristic(CharacteristicKey.BatteryLevel, 100, 'topicGetBatteryLevel', this.bindOnUpdateNumeric(CharacteristicKey.BatteryLevel, strings.accessory.batteryLevel), false);
|
|
18
|
-
this.setupCharacteristic(CharacteristicKey.StatusLowBattery,
|
|
20
|
+
this.setupCharacteristic(CharacteristicKey.StatusLowBattery, Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL, 'topicGetBatteryLow', this.onBatteryLowUpdate.bind(this), false);
|
|
19
21
|
this.setupCharacteristic(CharacteristicKey.StatusActive, true, 'topicGetStatusActive', this.onStatusActiveUpdate.bind(this), false);
|
|
20
22
|
}
|
|
21
23
|
async onBatteryLowUpdate(topic, value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/accessory/abstract/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAO,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,OAAgB,aAAmE,SAAQ,aAAgB;IAE/G,YAAY,OAAoB,EAAE,cAAkC,EAAE,SAA4B,EAAE,MAAS,EAAE,GAAQ,E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AAY,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,oBAAoB,CAAC,KAAa,EAAE,KAAqB;QAErE,MAAM,YAAY,GAAG,KAAK,KAAK,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,CAAC;YACjE,OAAO;QACT,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -2,7 +2,8 @@ import { strings } from '../../i18n/i18n.js';
|
|
|
2
2
|
import { AccessoryType } from '../../model/enums.js';
|
|
3
3
|
import { LockMechanismAccessory } from '../lock.js';
|
|
4
4
|
import { SecuritySystemAccessory } from '../security.js';
|
|
5
|
-
import {
|
|
5
|
+
import { HeaterCoolerAccessory } from '../climate/heaterCooler.js';
|
|
6
|
+
import { ThermostatAccessory } from '../climate/thermostat.js';
|
|
6
7
|
import { LightbulbAccessory } from '../onoff/lightbulb.js';
|
|
7
8
|
import { OutletAccessory } from '../onoff/outlet.js';
|
|
8
9
|
import { SwitchAccessory } from '../onoff/switch.js';
|
|
@@ -23,6 +24,8 @@ export function createAccessory(Service, Characteristic, platformAccessory, acce
|
|
|
23
24
|
return new COSensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
24
25
|
case AccessoryType.ContactSensor:
|
|
25
26
|
return new ContactSensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
27
|
+
case AccessoryType.HeaterCooler:
|
|
28
|
+
return new HeaterCoolerAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
26
29
|
case AccessoryType.HumiditySensor:
|
|
27
30
|
return new HumiditySensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
28
31
|
case AccessoryType.LeakSensor:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/accessory/abstract/helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/accessory/abstract/helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AA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c,EAAE,iBAAiB,EAAE,eAAuC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAClI,KAAK,aAAa,CAAC,iBAAiB;YAClC,OAAO,IAAI,0BAA0B,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAkD,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QACxJ,KAAK,aAAa,CAAC,UAAU;YAC3B,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAA2C,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC1I,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CharacteristicValue, PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { BaseAccessory } from '../abstract/base.js';
|
|
3
|
+
import { TemperatureUnits } from '../../model/enums.js';
|
|
4
|
+
import { CharacteristicType, ClimateControlConfig, ServiceType } from '../../model/types.js';
|
|
5
|
+
import { Log } from '../../tools/log.js';
|
|
6
|
+
export declare const DEFAULT_TEMPERATURE = 10;
|
|
7
|
+
export declare abstract class ClimateControlAccessory<C extends ClimateControlConfig = ClimateControlConfig> extends BaseAccessory<C> {
|
|
8
|
+
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log, isGrouped: boolean);
|
|
9
|
+
protected get temperatureUnits(): TemperatureUnits;
|
|
10
|
+
private bindOnSetThreshold;
|
|
11
|
+
protected temperatureFromCV(value: CharacteristicValue): number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseAccessory } from '../abstract/base.js';
|
|
2
|
+
import { strings } from '../../i18n/i18n.js';
|
|
3
|
+
import { CharacteristicKey, TemperatureUnits } from '../../model/enums.js';
|
|
4
|
+
import { fromCelsius } from '../../tools/temperature.js';
|
|
5
|
+
export const DEFAULT_TEMPERATURE = 10;
|
|
6
|
+
const DEFAULT_COOLING_THRESHOLD = 25;
|
|
7
|
+
const DEFAULT_HEATING_THRESHOLD = 20;
|
|
8
|
+
export class ClimateControlAccessory extends BaseAccessory {
|
|
9
|
+
constructor(Service, Characteristic, accessory, config, log, isGrouped) {
|
|
10
|
+
super(Service, Characteristic, accessory, config, log, isGrouped);
|
|
11
|
+
this.setCharacteristicValue(CharacteristicKey.TemperatureDisplayUnits, this.temperatureUnits === TemperatureUnits.FAHRENHEIT ? 1 : 0);
|
|
12
|
+
this.setupCharacteristic(CharacteristicKey.CurrentTemperature, DEFAULT_TEMPERATURE, 'topicGetCurrentTemperature', this.bindTemperatureUpdate(config, CharacteristicKey.CurrentTemperature, strings.climate.temperatureUpdate), true);
|
|
13
|
+
this.setupCharacteristic(CharacteristicKey.CoolingThresholdTemperature, DEFAULT_COOLING_THRESHOLD, 'topicGetCoolingThresholdTemperature', this.bindTemperatureUpdate(config, CharacteristicKey.CoolingThresholdTemperature, strings.climate.coolingThreshold), false, 'topicSetCoolingThresholdTemperature', this.bindOnSetThreshold(CharacteristicKey.CoolingThresholdTemperature, 'topicSetCoolingThresholdTemperature', strings.climate.coolingThresholdFuture));
|
|
14
|
+
this.setupCharacteristic(CharacteristicKey.HeatingThresholdTemperature, DEFAULT_HEATING_THRESHOLD, 'topicGetHeatingThresholdTemperature', this.bindTemperatureUpdate(config, CharacteristicKey.HeatingThresholdTemperature, strings.climate.heatingThreshold), false, 'topicSetHeatingThresholdTemperature', this.bindOnSetThreshold(CharacteristicKey.HeatingThresholdTemperature, 'topicSetHeatingThresholdTemperature', strings.climate.heatingThresholdFuture));
|
|
15
|
+
}
|
|
16
|
+
get temperatureUnits() {
|
|
17
|
+
return this.config.temperatureUnits ?? TemperatureUnits.CELSIUS;
|
|
18
|
+
}
|
|
19
|
+
bindOnSetThreshold(charKey, topic, logTemplate) {
|
|
20
|
+
return (async (value) => {
|
|
21
|
+
const temperature = this.temperatureFromCV(value);
|
|
22
|
+
const logString = logTemplate.replace('%d°%s', `${temperature}°${this.temperatureUnits}`);
|
|
23
|
+
this.onSet(charKey, value, temperature, topic, logString);
|
|
24
|
+
}).bind(this);
|
|
25
|
+
}
|
|
26
|
+
temperatureFromCV(value) {
|
|
27
|
+
const celsiusTemperature = value;
|
|
28
|
+
return this.temperatureUnits === TemperatureUnits.FAHRENHEIT ? fromCelsius(celsiusTemperature, this.temperatureUnits) : celsiusTemperature;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=climate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"climate.js","sourceRoot":"","sources":["../../../src/accessory/climate/climate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI3E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC,MAAM,OAAgB,uBAA+E,SAAQ,aAAgB;IAE3H,YAAY,OAAoB,EAAE,cAAkC,EAAE,SAA4B,EAAE,MAAS,EAAE,GAAQ,EAAE,SAAkB;QACzI,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAElE,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,IAAI,CAAC,gBAAgB,KAAK,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,WAAW,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAC1F,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAES,iBAAiB,CAAC,KAA0B;QACpD,MAAM,kBAAkB,GAAG,KAAe,CAAC;QAC3C,OAAO,IAAI,CAAC,gBAAgB,KAAK,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,kBAAkB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAC7I,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { ClimateControlAccessory } from './climate.js';
|
|
3
|
+
import { AccessoryType } from '../../model/enums.js';
|
|
4
|
+
import { CharacteristicType, ServiceType, HeaterCoolerConfig } from '../../model/types.js';
|
|
5
|
+
import { Log } from '../../tools/log.js';
|
|
6
|
+
export declare class HeaterCoolerAccessory extends ClimateControlAccessory<HeaterCoolerConfig> {
|
|
7
|
+
private readonly CURRENT_STATE_MAP;
|
|
8
|
+
private readonly TARGET_STATE_MAP;
|
|
9
|
+
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: HeaterCoolerConfig, log: Log, isGrouped: boolean);
|
|
10
|
+
protected getAccessoryType(): AccessoryType;
|
|
11
|
+
private onCurrentStateUpdate;
|
|
12
|
+
private onTargetStateUpdate;
|
|
13
|
+
private onSetTargetState;
|
|
14
|
+
private onSetActive;
|
|
15
|
+
private onSetLockControls;
|
|
16
|
+
private onSetRotationSpeed;
|
|
17
|
+
private onSetSwingMode;
|
|
18
|
+
private fromCVState;
|
|
19
|
+
private toCurrentCVState;
|
|
20
|
+
private toTargetCVState;
|
|
21
|
+
private stateStringForCurrentCV;
|
|
22
|
+
private stateStringForTargetCV;
|
|
23
|
+
}
|