iobroker.iot 3.6.0 → 4.0.2
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 +8 -4
- package/admin/assets/index-5zouxn2w.js +680 -0
- package/admin/index_m.html +1 -1
- package/admin/rules/assets/{index-BRdNnGcA.js → index-DwYdaT5M.js} +80 -81
- package/admin/rules/customRuleBlocks.js +2 -2
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/AlexaResponse.js +101 -95
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Capabilities/Base.js +22 -36
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Base.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js +19 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js +14 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js +19 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js +16 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js +14 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.js +27 -28
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js +14 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js +14 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js +19 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js +25 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js +14 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js +37 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js +32 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js +29 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.js +34 -27
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js +39 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Directives/ReportState.js +19 -22
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/ReportState.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/index.js +14 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/index.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js +36 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js +57 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js +57 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js +12 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js +16 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js +127 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js +18 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js +38 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.js +20 -29
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js +23 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Properties/LockState.js +9 -12
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js +34 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js +19 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js +18 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Properties/PowerState.js +9 -9
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js +31 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js +22 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js +49 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js +21 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/index.js +38 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/index.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js +20 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js +26 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/AirCondition.js +148 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/AirCondition.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Blind.js +13 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Blind.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/ContactSensor.js +17 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/ContactSensor.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Controls/Control.js +73 -104
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Control.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Ct.js +182 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Ct.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Dimmer.js +127 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Dimmer.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Door.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Door.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Gate.js +38 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Gate.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Hue.js +208 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Hue.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Controls/Light.js +15 -22
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Light.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Lock.js +35 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Lock.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Motion.js +17 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Motion.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js +26 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Slider.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Slider.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Socket.js +21 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Socket.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Temperature.js +21 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Temperature.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Thermostat.js +85 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Thermostat.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js +27 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Volume.js +116 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Volume.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Window.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/Window.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/index.js +121 -0
- package/build-backend/lib/AlexaSmartHomeV3/Controls/index.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Device.js +29 -30
- package/build-backend/lib/AlexaSmartHomeV3/Device.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/DeviceManager.js +392 -0
- package/build-backend/lib/AlexaSmartHomeV3/DeviceManager.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js +10 -0
- package/build-backend/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Helpers/AdapterProvider.js +12 -21
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/AdapterProvider.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/FileHelper.js +53 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/FileHelper.js.map +1 -0
- package/{lib → build-backend/lib}/AlexaSmartHomeV3/Helpers/IotProxy.js +9 -26
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/IotProxy.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/Logger.js +93 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/Logger.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +112 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/Utils.js +625 -0
- package/build-backend/lib/AlexaSmartHomeV3/Helpers/Utils.js.map +1 -0
- package/build-backend/lib/Utils.js +96 -0
- package/build-backend/lib/Utils.js.map +1 -0
- package/build-backend/lib/adminCommonSocket.js +715 -0
- package/build-backend/lib/adminCommonSocket.js.map +1 -0
- package/build-backend/lib/alexaCustom.js +542 -0
- package/build-backend/lib/alexaCustom.js.map +1 -0
- package/{lib → build-backend/lib}/alexaSmartHomeV2.js +4 -8
- package/{lib → build-backend/lib}/alexaSmartHomeV3.js +25 -45
- package/build-backend/lib/alexaSmartHomeV3.js.map +1 -0
- package/{lib → build-backend/lib}/alisa.js +41 -44
- package/{lib → build-backend/lib}/devices.js +11 -8
- package/build-backend/lib/devices.js.map +1 -0
- package/{lib → build-backend/lib}/functions.js +11 -8
- package/build-backend/lib/functions.js.map +1 -0
- package/{lib → build-backend/lib}/googleHome.js +25 -26
- package/{lib → build-backend/lib}/notifications.js +15 -22
- package/build-backend/lib/notifications.js.map +1 -0
- package/{lib → build-backend/lib}/remote.js +615 -636
- package/build-backend/lib/remote.js.map +1 -0
- package/{lib → build-backend/lib}/rooms.js +11 -8
- package/build-backend/lib/rooms.js.map +1 -0
- package/{lib → build-backend/lib}/texts.js +6 -4
- package/build-backend/lib/texts.js.map +1 -0
- package/build-backend/lib/translate.js +21 -0
- package/build-backend/lib/translate.js.map +1 -0
- package/{lib → build-backend/lib}/visuApp.js +45 -65
- package/build-backend/lib/visuApp.js.map +1 -0
- package/build-backend/main.js +1361 -0
- package/build-backend/main.js.map +1 -0
- package/io-package.json +14 -14
- package/package.json +18 -15
- package/admin/assets/index-DCbOB3g_.js +0 -681
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js +0 -15
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js +0 -10
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js +0 -15
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js +0 -10
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js +0 -10
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js +0 -10
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js +0 -10
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js +0 -15
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js +0 -20
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js +0 -10
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js +0 -34
- package/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js +0 -14
- package/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js +0 -27
- package/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js +0 -39
- package/lib/AlexaSmartHomeV3/Alexa/Directives/index.js +0 -13
- package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js +0 -38
- package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js +0 -55
- package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js +0 -56
- package/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js +0 -14
- package/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js +0 -11
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js +0 -108
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js +0 -14
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js +0 -40
- package/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js +0 -22
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js +0 -32
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js +0 -17
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js +0 -14
- package/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js +0 -28
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js +0 -20
- package/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js +0 -52
- package/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js +0 -19
- package/lib/AlexaSmartHomeV3/Alexa/Properties/index.js +0 -14
- package/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js +0 -22
- package/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js +0 -28
- package/lib/AlexaSmartHomeV3/Controls/AirCondition.js +0 -144
- package/lib/AlexaSmartHomeV3/Controls/Blind.js +0 -12
- package/lib/AlexaSmartHomeV3/Controls/ContactSensor.js +0 -17
- package/lib/AlexaSmartHomeV3/Controls/Ct.js +0 -172
- package/lib/AlexaSmartHomeV3/Controls/Dimmer.js +0 -124
- package/lib/AlexaSmartHomeV3/Controls/Door.js +0 -9
- package/lib/AlexaSmartHomeV3/Controls/Gate.js +0 -42
- package/lib/AlexaSmartHomeV3/Controls/Hue.js +0 -207
- package/lib/AlexaSmartHomeV3/Controls/Lock.js +0 -36
- package/lib/AlexaSmartHomeV3/Controls/Motion.js +0 -17
- package/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js +0 -25
- package/lib/AlexaSmartHomeV3/Controls/Slider.js +0 -10
- package/lib/AlexaSmartHomeV3/Controls/Socket.js +0 -21
- package/lib/AlexaSmartHomeV3/Controls/Temperature.js +0 -22
- package/lib/AlexaSmartHomeV3/Controls/Thermostat.js +0 -86
- package/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js +0 -28
- package/lib/AlexaSmartHomeV3/Controls/Volume.js +0 -109
- package/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js +0 -9
- package/lib/AlexaSmartHomeV3/Controls/Window.js +0 -9
- package/lib/AlexaSmartHomeV3/Controls/index.js +0 -14
- package/lib/AlexaSmartHomeV3/DeviceManager.js +0 -415
- package/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js +0 -8
- package/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js +0 -5
- package/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js +0 -5
- package/lib/AlexaSmartHomeV3/Helpers/FileHelper.js +0 -70
- package/lib/AlexaSmartHomeV3/Helpers/Logger.js +0 -95
- package/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +0 -82
- package/lib/AlexaSmartHomeV3/Helpers/Utils.js +0 -583
- package/lib/Utils.js +0 -608
- package/lib/adminCommonSocket.js +0 -781
- package/lib/alexaCustom.js +0 -622
- package/lib/translate.js +0 -19
- package/main.js +0 -1454
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const AdjustableControl = require('./AdjustableControl');
|
|
3
|
-
const Utils = require('../Helpers/Utils');
|
|
4
|
-
const Properties = require('../Alexa/Properties');
|
|
5
|
-
const AdapterProvider = require('../Helpers/AdapterProvider');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @class
|
|
9
|
-
*/
|
|
10
|
-
class Dimmer extends AdjustableControl {
|
|
11
|
-
get categories() {
|
|
12
|
-
return ['LIGHT'];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
adjustableProperties() {
|
|
16
|
-
return [Properties.Brightness];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
initCapabilities() {
|
|
20
|
-
this._powerControllerCapability = new Capabilities.PowerController();
|
|
21
|
-
this._powerState = this._powerControllerCapability.powerState;
|
|
22
|
-
|
|
23
|
-
this._brightnessCapability = new Capabilities.BrightnessController();
|
|
24
|
-
this._brightness = this._brightnessCapability.brightness;
|
|
25
|
-
|
|
26
|
-
let result = [this._powerControllerCapability, this._brightnessCapability];
|
|
27
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
28
|
-
property.init(this.composeInitObject(property))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async setState(property, value) {
|
|
35
|
-
// set the property itself
|
|
36
|
-
await AdapterProvider.setState(property.setId, value);
|
|
37
|
-
property.currentValue = value;
|
|
38
|
-
const valuesRange = Utils.configuredRangeOrDefault(this.states[this.statesMap.set]);
|
|
39
|
-
|
|
40
|
-
// todo: use adapter.config.deviceOffLevel
|
|
41
|
-
// If
|
|
42
|
-
|
|
43
|
-
if (property.propertyName === Properties.PowerState.propertyName) {
|
|
44
|
-
// set brightness
|
|
45
|
-
if (value) {
|
|
46
|
-
// set byOn to the configured value or 100 otherwise
|
|
47
|
-
let byOn = this.states[this.statesMap.set].smartName?.byON;
|
|
48
|
-
byOn = isNaN(byOn) ? valuesRange.max : parseInt(byOn);
|
|
49
|
-
await AdapterProvider.setState(this._brightness.setId, byOn);
|
|
50
|
-
this._brightness.currentValue = byOn;
|
|
51
|
-
} else { // set brightness to 0 on power OFF
|
|
52
|
-
await AdapterProvider.setState(this._brightness.setId, valuesRange.min);
|
|
53
|
-
this._brightness.currentValue = valuesRange.min;
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
// set power
|
|
57
|
-
const powerValue = value !== valuesRange.min;
|
|
58
|
-
|
|
59
|
-
// only do this on different IDs for brightness and power
|
|
60
|
-
if (this._brightness.setId !== this._powerState.setId) {
|
|
61
|
-
await AdapterProvider.setState(this._powerState.setId, powerValue);
|
|
62
|
-
}
|
|
63
|
-
this._powerState.currentValue = powerValue;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async getOrRetrieveCurrentValue(property) {
|
|
68
|
-
if (property.currentValue === undefined) {
|
|
69
|
-
property.currentValue = await AdapterProvider.getState(property.getId);
|
|
70
|
-
|
|
71
|
-
const valuesRange = Utils.configuredRangeOrDefault(this.states[this.statesMap.set]);
|
|
72
|
-
// convert non-zero brightness to power = true
|
|
73
|
-
if (property.propertyName === this._powerState.propertyName && property.getId === this._brightness.getId) {
|
|
74
|
-
property.currentValue = property.currentValue !== valuesRange.min;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (property.currentValue === undefined) {
|
|
79
|
-
throw new Error(`unable to retrieve ${property.getId}`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return property.currentValue;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
composeInitObject(property) {
|
|
86
|
-
/*
|
|
87
|
-
Device of type 'dimmer' can be switched 'ON'/'OFF' and its brightness can be set to a value between 0 and 100.
|
|
88
|
-
|
|
89
|
-
If there is no 'ON_SET' state available:
|
|
90
|
-
- switching control 'OFF' is done via setting its brightness to 0
|
|
91
|
-
- switching control 'ON' is done via setting its brightness to the configured 'byOn' value or to the last known brightness.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
const map = this.statesMap;
|
|
95
|
-
|
|
96
|
-
if (property.propertyName === Properties.PowerState.propertyName) {
|
|
97
|
-
return {
|
|
98
|
-
setState: this.states[map.on_set] || this.states[map.set],
|
|
99
|
-
getState: this.states[map.on_actual] || this.states[map.on_set] || this.states[map.set],
|
|
100
|
-
alexaSetter: function (alexaValue) {
|
|
101
|
-
return alexaValue === Properties.PowerState.ON;
|
|
102
|
-
},
|
|
103
|
-
alexaGetter: function (value) {
|
|
104
|
-
return value ? Properties.PowerState.ON : Properties.PowerState.OFF;
|
|
105
|
-
},
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (property.propertyName === Properties.Brightness.propertyName) {
|
|
110
|
-
return {
|
|
111
|
-
setState: this.states[map.set],
|
|
112
|
-
getState: this.states[map.actual],
|
|
113
|
-
alexaSetter: function (alexaValue) {
|
|
114
|
-
return Utils.denormalize_0_100(alexaValue, this.valuesRangeMin, this.valuesRangeMax);
|
|
115
|
-
},
|
|
116
|
-
alexaGetter: function (value) {
|
|
117
|
-
return Utils.normalize_0_100(value, this.valuesRangeMin, this.valuesRangeMax);
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
module.exports = Dimmer;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const Modes = require('../Alexa/ModeValues');
|
|
3
|
-
const Control = require('./Control');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @class
|
|
7
|
-
*/
|
|
8
|
-
class Gate extends Control {
|
|
9
|
-
get categories() {
|
|
10
|
-
return ['GARAGE_DOOR'];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
initCapabilities() {
|
|
14
|
-
let result = [new Capabilities.ModeController()];
|
|
15
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
16
|
-
property.init(this.modeInitObject());
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
modeInitObject() {
|
|
22
|
-
const map = this.statesMap;
|
|
23
|
-
const mode = 'Gate.Position';
|
|
24
|
-
return {
|
|
25
|
-
setState: this.states[map.set],
|
|
26
|
-
getState: this.states[map.set],
|
|
27
|
-
alexaSetter: function (alexaValue) {
|
|
28
|
-
return alexaValue === `${mode}.${Modes.Open.value}`;
|
|
29
|
-
},
|
|
30
|
-
alexaGetter: function (value) {
|
|
31
|
-
return value ? `${mode}.${Modes.Open.value}` : `${mode}.${Modes.Closed.value}`;
|
|
32
|
-
},
|
|
33
|
-
instance: mode,
|
|
34
|
-
supportedModes: [
|
|
35
|
-
new Modes.Open(mode),
|
|
36
|
-
new Modes.Closed(mode)
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
module.exports = Gate;
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const Utils = require('../Helpers/Utils');
|
|
3
|
-
const Properties = require('../Alexa/Properties');
|
|
4
|
-
const AdapterProvider = require('../Helpers/AdapterProvider');
|
|
5
|
-
const AdjustableControl = require('./AdjustableControl');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @class
|
|
9
|
-
*/
|
|
10
|
-
class Hue extends AdjustableControl {
|
|
11
|
-
get categories() {
|
|
12
|
-
return ['LIGHT'];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
adjustableProperties() {
|
|
16
|
-
return [Properties.ColorTemperatureInKelvin];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
initCapabilities() {
|
|
20
|
-
const map = this.statesMap;
|
|
21
|
-
const result = [new Capabilities.ColorController()];
|
|
22
|
-
|
|
23
|
-
// if the state DIMMER or BRIGHTNESS configured
|
|
24
|
-
if (this.states[map.dimmer] || this.states[map.brightness]) {
|
|
25
|
-
this._brightnessCapability = new Capabilities.BrightnessController();
|
|
26
|
-
this._brightness = this._brightnessCapability.brightness;
|
|
27
|
-
result.push(this._brightnessCapability);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// if the state TEMPERATURE configured
|
|
31
|
-
if (this.states[map.temperature]) {
|
|
32
|
-
this._colorTemperatureCapability = new Capabilities.ColorTemperatureController();
|
|
33
|
-
result.push(this._colorTemperatureCapability);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// if the state ON, DIMMER or BRIGHTNESS configured
|
|
37
|
-
if (this.states[map.on] || this._brightness) {
|
|
38
|
-
this._powerControllerCapability = new Capabilities.PowerController();
|
|
39
|
-
this._powerState = this._powerControllerCapability.powerState;
|
|
40
|
-
result.push(this._powerControllerCapability);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
44
|
-
property.init(this.composeInitObject(property))
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async getOrRetrieveCurrentValue(property) {
|
|
51
|
-
const map = this.statesMap;
|
|
52
|
-
|
|
53
|
-
if (property.currentValue === undefined) {
|
|
54
|
-
property.currentValue = await AdapterProvider.getState(property.getId);
|
|
55
|
-
// convert the non-zero brightness to power = true
|
|
56
|
-
if (property.propertyName === Properties.PowerState.propertyName && !this.states[map.on]) {
|
|
57
|
-
property.currentValue = property.currentValue !== 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (property.propertyName === Properties.Color.propertyName) {
|
|
61
|
-
property.currentValue = {
|
|
62
|
-
hue: property.currentValue,
|
|
63
|
-
saturation: property.hal.saturation,
|
|
64
|
-
brightness: property.hal.brightness
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (property.currentValue === undefined) {
|
|
70
|
-
throw new Error(`unable to retrieve ${property.getId}`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return property.currentValue;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async setState(property, value) {
|
|
77
|
-
const map = this.statesMap;
|
|
78
|
-
|
|
79
|
-
if (property.propertyName === Properties.PowerState.propertyName) {
|
|
80
|
-
if (this.states[map.on]) {
|
|
81
|
-
await AdapterProvider.setState(property.setId, value);
|
|
82
|
-
property.currentValue = value;
|
|
83
|
-
} else {
|
|
84
|
-
if (value) { // set brightness
|
|
85
|
-
// set byOn to the configured value or range.max otherwise
|
|
86
|
-
const range = Utils.configuredRangeOrDefault(this.states[map.dimmer] || this.states[map.brightness]);
|
|
87
|
-
let byOn = (this.states[map.dimmer] || this.states[map.brightness])?.smartName?.byON;
|
|
88
|
-
byOn = isNaN(byOn) ? range.max : parseInt(byOn);
|
|
89
|
-
await AdapterProvider.setState(this._brightness.setId, byOn);
|
|
90
|
-
this._brightness.currentValue = byOn;
|
|
91
|
-
this._powerState.currentValue = true;
|
|
92
|
-
} else { // set brightness to 0 on power OFF
|
|
93
|
-
await AdapterProvider.setState(this._brightness.setId, 0);
|
|
94
|
-
this._brightness.currentValue = 0;
|
|
95
|
-
this._powerState.currentValue = false;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
} else
|
|
99
|
-
if (property.propertyName === Properties.Brightness.propertyName
|
|
100
|
-
|| property.propertyName === Properties.ColorTemperatureInKelvin.propertyName) {
|
|
101
|
-
await AdapterProvider.setState(property.setId, value);
|
|
102
|
-
property.currentValue = value;
|
|
103
|
-
} else
|
|
104
|
-
if (property.propertyName === Properties.Color.propertyName) {
|
|
105
|
-
await AdapterProvider.setState(property.hal.hue, value.hue);
|
|
106
|
-
if (property.hal.saturation) {
|
|
107
|
-
await AdapterProvider.setState(property.hal.saturation, value.saturation);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// do not set brightness
|
|
111
|
-
|
|
112
|
-
// https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-colorcontroller.html
|
|
113
|
-
// Important: For the best user experience, when you make a color change, maintain the current brightness setting of the endpoint.
|
|
114
|
-
// For example, if a light bulb is currently set to white at 0.5 brightness, and a user requests a color change to red,
|
|
115
|
-
// the SetColor directive specifies hue = 0, saturation = 1, and brightness = 1. Here, set the hue to 0, the saturation to 1,
|
|
116
|
-
// and ignore the brightness value of 1 in the directive. Instead, maintain the current brightness value of 0.5.
|
|
117
|
-
|
|
118
|
-
property.currentValue = value;
|
|
119
|
-
} else
|
|
120
|
-
if (property.propertyName === Properties.ColorTemperatureInKelvin.propertyName) {
|
|
121
|
-
// TODO: Check with gh_got
|
|
122
|
-
await AdapterProvider.setState(property.setId, value.colorTemperatureInKelvin);
|
|
123
|
-
property.currentValue = value;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async adjustValue(event, property) {
|
|
128
|
-
// extract Alexa delta value from event
|
|
129
|
-
const delta = property.alexaDirectiveValue(event);
|
|
130
|
-
|
|
131
|
-
// convert delta to iobroker value
|
|
132
|
-
const value = property.value(delta);
|
|
133
|
-
|
|
134
|
-
// set iobroker state
|
|
135
|
-
await this.setState(property, value);
|
|
136
|
-
|
|
137
|
-
return value;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
composeInitObject(property) {
|
|
141
|
-
const map = this.statesMap;
|
|
142
|
-
|
|
143
|
-
if (property.propertyName === Properties.PowerState.propertyName) {
|
|
144
|
-
return {
|
|
145
|
-
setState: this.states[map.on] || this.states[map.dimmer] || this.states[map.brightness],
|
|
146
|
-
getState: this.states[map.on] || this.states[map.dimmer] || this.states[map.brightness],
|
|
147
|
-
alexaSetter: function (alexaValue) {
|
|
148
|
-
return alexaValue === Properties.PowerState.ON;
|
|
149
|
-
},
|
|
150
|
-
alexaGetter: function (value) {
|
|
151
|
-
return value ? Properties.PowerState.ON : Properties.PowerState.OFF;
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (property.propertyName === Properties.Brightness.propertyName) {
|
|
157
|
-
return {
|
|
158
|
-
setState: this.states[map.dimmer] || this.states[map.brightness],
|
|
159
|
-
getState: this.states[map.dimmer] || this.states[map.brightness],
|
|
160
|
-
alexaSetter: function (alexaValue) {
|
|
161
|
-
return Utils.denormalize_0_100(alexaValue, this.valuesRangeMin, this.valuesRangeMax);
|
|
162
|
-
},
|
|
163
|
-
alexaGetter: function (value) {
|
|
164
|
-
return Utils.normalize_0_100(value, this.valuesRangeMin, this.valuesRangeMax);
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (property.propertyName === Properties.Color.propertyName) {
|
|
170
|
-
return {
|
|
171
|
-
hal: {
|
|
172
|
-
hue: this.states[map.hue].id,
|
|
173
|
-
saturation: this.states[map.saturation]?.id,
|
|
174
|
-
brightness: (this.states[map.dimmer] || this.states[map.brightness])?.id
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (property.propertyName === Properties.ColorTemperatureInKelvin.propertyName) {
|
|
180
|
-
return {
|
|
181
|
-
setState: this.states[map.temperature],
|
|
182
|
-
getState: this.states[map.temperature],
|
|
183
|
-
alexaSetter: function (alexaValue) {
|
|
184
|
-
if (alexaValue === 1) { // increase directive
|
|
185
|
-
const closest = Utils.closestFromList(this.currentValue || this.colorTemperatureTable[0], this.colorTemperatureTable);
|
|
186
|
-
let index = this.colorTemperatureTable.indexOf(closest) + 1;
|
|
187
|
-
index = index >= this.colorTemperatureTable.length ? this.colorTemperatureTable.length - 1 : index;
|
|
188
|
-
return this.colorTemperatureTable[index];
|
|
189
|
-
}
|
|
190
|
-
if (alexaValue === -1) { // decrease directive
|
|
191
|
-
const closest = Utils.closestFromList(this.currentValue || this.colorTemperatureTable[0], this.colorTemperatureTable);
|
|
192
|
-
let index = this.colorTemperatureTable.indexOf(closest) - 1;
|
|
193
|
-
index = index < 0 ? 0 : index;
|
|
194
|
-
return this.colorTemperatureTable[index];
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return alexaValue;
|
|
198
|
-
},
|
|
199
|
-
alexaGetter: function (value) {
|
|
200
|
-
return value;
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
module.exports = Hue;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const Properties = require('../Alexa/Properties');
|
|
3
|
-
const Control = require('./Control');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @class
|
|
7
|
-
*/
|
|
8
|
-
class Lock extends Control {
|
|
9
|
-
get categories() {
|
|
10
|
-
return ['SMARTLOCK'];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
initCapabilities() {
|
|
14
|
-
let result = [new Capabilities.LockController()];
|
|
15
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
16
|
-
property.init(this.lockStateInitObject());
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
lockStateInitObject() {
|
|
22
|
-
const map = this.statesMap;
|
|
23
|
-
return {
|
|
24
|
-
setState: this.states[map.set],
|
|
25
|
-
getState: this.states[map.actual],
|
|
26
|
-
alexaSetter: function (alexaValue) {
|
|
27
|
-
return alexaValue === Properties.LockState.UNLOCK;
|
|
28
|
-
},
|
|
29
|
-
alexaGetter: function (value) {
|
|
30
|
-
return value ? Properties.LockState.UNLOCKED : Properties.LockState.LOCKED;
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = Lock;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const ReadOnlyDetector = require('./ReadOnlyDetector');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
*/
|
|
7
|
-
class Motion extends ReadOnlyDetector {
|
|
8
|
-
get capability() {
|
|
9
|
-
return new Capabilities.MotionSensor();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
get categories() {
|
|
13
|
-
return ['MOTION_SENSOR'];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = Motion;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const AlexaResponse = require('../Alexa/AlexaResponse');
|
|
2
|
-
const Control = require('./Control');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
*/
|
|
7
|
-
class ReadOnlyDetector extends Control {
|
|
8
|
-
get capability() {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
initCapabilities() {
|
|
13
|
-
let result = [this.capability];
|
|
14
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
15
|
-
property.init(this.detectedStateInitObject())
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
async handle(event) {
|
|
20
|
-
this.log.error(`Setting value is not supported by ${this.name} control`);
|
|
21
|
-
return Promise.reject(AlexaResponse.directiveNotSupportedByControl(this.name, event?.directive?.header?.namespace, event?.directive?.header?.payloadVersion).get());
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = ReadOnlyDetector;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const Control = require('./Control');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
*/
|
|
7
|
-
class Socket extends Control {
|
|
8
|
-
get categories() {
|
|
9
|
-
return ['SMARTPLUG'];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
initCapabilities() {
|
|
13
|
-
let result = [new Capabilities.PowerController()];
|
|
14
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
15
|
-
property.init(this.powerStateInitObject());
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
module.exports = Socket;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const Control = require('./Control');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
*/
|
|
7
|
-
class Temperature extends Control {
|
|
8
|
-
get categories() {
|
|
9
|
-
return ['TEMPERATURE_SENSOR'];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
initCapabilities() {
|
|
13
|
-
let result = [new Capabilities.TemperatureSensor()];
|
|
14
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
15
|
-
property.init(this.blankInitObject())
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = Temperature;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const AdjustableControl = require('./AdjustableControl');
|
|
3
|
-
const Utils = require('../Helpers/Utils');
|
|
4
|
-
const Properties = require('../Alexa/Properties');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @class
|
|
8
|
-
*/
|
|
9
|
-
class Thermostat extends AdjustableControl {
|
|
10
|
-
get categories() {
|
|
11
|
-
return ['THERMOSTAT', 'TEMPERATURE_SENSOR']
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
adjustableProperties() {
|
|
15
|
-
return [Properties.TargetSetpoint];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
initCapabilities() {
|
|
19
|
-
let result = [new Capabilities.TemperatureSensor(), new Capabilities.ThermostatController()];
|
|
20
|
-
const map = this.statesMap;
|
|
21
|
-
// if the state POWER is present, then we can switch it ON/OFF
|
|
22
|
-
if (this.states[map.power]) {
|
|
23
|
-
result.push(new Capabilities.PowerController());
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
27
|
-
property.init(this.composeInitObject(property));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
composeInitObject(property) {
|
|
34
|
-
const map = this.statesMap;
|
|
35
|
-
|
|
36
|
-
if (property.propertyName === Properties.PowerState.propertyName) {
|
|
37
|
-
return {
|
|
38
|
-
setState: this.states[map.power] || this.states[map.set],
|
|
39
|
-
getState: this.states[map.power] || this.states[map.set],
|
|
40
|
-
alexaSetter: function (alexaValue) {
|
|
41
|
-
return alexaValue === Properties.PowerState.ON;
|
|
42
|
-
},
|
|
43
|
-
alexaGetter: function (value) {
|
|
44
|
-
return value ? Properties.PowerState.ON : Properties.PowerState.OFF;
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (property.propertyName === Properties.Temperature.propertyName) {
|
|
50
|
-
return {
|
|
51
|
-
setState: this.states[map.set],
|
|
52
|
-
getState: this.states[map.actual] || this.states[map.set],
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (property.propertyName === Properties.TargetSetpoint.propertyName) {
|
|
57
|
-
return {
|
|
58
|
-
setState: this.states[map.set],
|
|
59
|
-
getState: this.states[map.actual] || this.states[map.set],
|
|
60
|
-
alexaSetter: function (alexaValue) {
|
|
61
|
-
return Utils.ensureValueInRange(alexaValue, this.valuesRangeMin, this.valuesRangeMax);
|
|
62
|
-
},
|
|
63
|
-
alexaGetter: function (value) {
|
|
64
|
-
return value;
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (property.propertyName === Properties.ThermostatMode.propertyName) {
|
|
70
|
-
const initObject = {
|
|
71
|
-
setState: this.states[map.mode] || { id: undefined },
|
|
72
|
-
getState: this.states[map.mode] || { id: undefined },
|
|
73
|
-
alexaSetter: function (alexaValue) {
|
|
74
|
-
return 0;
|
|
75
|
-
},
|
|
76
|
-
alexaGetter: function (value) {
|
|
77
|
-
return Properties.ThermostatMode.AUTO;
|
|
78
|
-
},
|
|
79
|
-
supportedModes: [Properties.ThermostatMode.AUTO]
|
|
80
|
-
};
|
|
81
|
-
return initObject;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
module.exports = Thermostat;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const Capabilities = require('../Alexa/Capabilities');
|
|
2
|
-
const Control = require('./Control');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
*/
|
|
7
|
-
class VacuumCleaner extends Control {
|
|
8
|
-
get categories() {
|
|
9
|
-
return ['VACUUM_CLEANER'];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
initCapabilities() {
|
|
13
|
-
let result = [new Capabilities.PowerController()];
|
|
14
|
-
for (const property of result.flatMap(item => item.properties)) {
|
|
15
|
-
property.init(this.powerStateInitObject());
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get statesMap() {
|
|
21
|
-
return {
|
|
22
|
-
'set': 'POWER',
|
|
23
|
-
'actual': undefined
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
module.exports = VacuumCleaner;
|