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,15 +0,0 @@
|
|
|
1
|
-
const Properties = require('../Properties');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class BrightnessController extends Base {
|
|
5
|
-
initProperties() {
|
|
6
|
-
this._brightness = new Properties.Brightness();
|
|
7
|
-
return [this._brightness];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
get brightness() {
|
|
11
|
-
return this._brightness;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = BrightnessController;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const Properties = require('../Properties');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class ColorTemperatureController extends Base {
|
|
5
|
-
initProperties() {
|
|
6
|
-
this._colorTemperatureInKelvin = new Properties.ColorTemperatureInKelvin();
|
|
7
|
-
return [this._colorTemperatureInKelvin];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
get colorTemperatureInKelvin() {
|
|
11
|
-
return this._colorTemperatureInKelvin;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = ColorTemperatureController;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const Properties = require('./../Properties');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class PowerController extends Base {
|
|
5
|
-
initProperties() {
|
|
6
|
-
this._powerState = new Properties.PowerState();
|
|
7
|
-
return [this._powerState];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
get powerState() {
|
|
11
|
-
return this._powerState;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = PowerController;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const Properties = require('../Properties');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class Speaker extends Base {
|
|
5
|
-
initProperties() {
|
|
6
|
-
this._volume = new Properties.Volume();
|
|
7
|
-
this._muted = new Properties.Muted();
|
|
8
|
-
return [this._volume, this._muted];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
get volume() {
|
|
12
|
-
return this._volume;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
get muted() {
|
|
16
|
-
return this._muted;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
module.exports = Speaker;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const Properties = require('../Properties');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class ThermostatController extends Base {
|
|
5
|
-
get version() {
|
|
6
|
-
return '3.2';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
initProperties() {
|
|
10
|
-
this._thermostatMode = new Properties.ThermostatMode();
|
|
11
|
-
return [new Properties.TargetSetpoint(), this._thermostatMode];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
get thermostatMode() {
|
|
15
|
-
return this._thermostatMode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
get alexaResponse() {
|
|
19
|
-
return {
|
|
20
|
-
interface: this.namespace,
|
|
21
|
-
version: this.version,
|
|
22
|
-
properties: this.discoverableProperties,
|
|
23
|
-
configuration: this.configuration,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get configuration() {
|
|
28
|
-
return {
|
|
29
|
-
supportedModes: this._thermostatMode.supportedModes,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
module.exports = ThermostatController;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const capabilities = {};
|
|
2
|
-
const capabilitiesPath = require('path').join(__dirname);
|
|
3
|
-
const excludedNames = ['index', 'Base'];
|
|
4
|
-
|
|
5
|
-
require('fs')
|
|
6
|
-
.readdirSync(capabilitiesPath)
|
|
7
|
-
.forEach((file) => {
|
|
8
|
-
const name = file.replace(/\.js$/, '');
|
|
9
|
-
if (!excludedNames.includes(name)) {
|
|
10
|
-
capabilities[name] = require(`./${file}`);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
module.exports = capabilities;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const Logger = require('../../Helpers/Logger');
|
|
2
|
-
const Utils = require('../../Helpers/Utils');
|
|
3
|
-
|
|
4
|
-
class Base {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.log = new Logger(this);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
static get namespace() {
|
|
10
|
-
return `Alexa.${Utils.className(this.toString())}`;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Checks whether the directive matches, i.e., can handle the event Alexa sends to the skill
|
|
15
|
-
* @param event Contains the Alexa event.
|
|
16
|
-
* @returns {boolean}
|
|
17
|
-
*/
|
|
18
|
-
static matches(event) {
|
|
19
|
-
return event?.directive?.header?.namespace === this.namespace;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async handle(event, endpointManager) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = Base;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const AlexaResponse = require('../AlexaResponse');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class Discovery extends Base {
|
|
5
|
-
async handle(event, endpointManager) {
|
|
6
|
-
this.log.debug(`handling Discovery`);
|
|
7
|
-
this.log.silly(`${JSON.stringify(event)}`);
|
|
8
|
-
|
|
9
|
-
const endpoints = endpointManager.endpoints;
|
|
10
|
-
|
|
11
|
-
const response = new AlexaResponse({
|
|
12
|
-
namespace: Discovery.namespace,
|
|
13
|
-
name: 'Discover.Response',
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
let count = 0;
|
|
17
|
-
|
|
18
|
-
endpoints.forEach(endpoint => {
|
|
19
|
-
count++;
|
|
20
|
-
if (count > 300) {
|
|
21
|
-
this.log.warn(`Too many devices. Alexa supports up to 300 devices. ${endpoint.friendlyName} will not be discovered.`);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
response.addPayloadEndpoint({
|
|
25
|
-
endpointId: endpoint.id,
|
|
26
|
-
description: endpoint.description,
|
|
27
|
-
friendlyName: endpoint.friendlyName,
|
|
28
|
-
displayCategories: endpoint.displayCategories,
|
|
29
|
-
capabilities: endpoint.capabilities.map(capability => response.asEndpointCapability(capability.alexaResponse)),
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
this.log.silly(`${JSON.stringify(response.get())}`);
|
|
34
|
-
|
|
35
|
-
return response.get();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
module.exports = Discovery;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const directives = {};
|
|
2
|
-
const directivesPath = require('path').join(__dirname);
|
|
3
|
-
|
|
4
|
-
require('fs')
|
|
5
|
-
.readdirSync(directivesPath)
|
|
6
|
-
.forEach((file) => {
|
|
7
|
-
const name = file.replace(/\.js$/, '');
|
|
8
|
-
if (name !== 'index' && name !== 'Base') {
|
|
9
|
-
directives[name] = require(`./${file}`);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
module.exports = directives;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const Utils = require("../../Helpers/Utils");
|
|
2
|
-
|
|
3
|
-
class Base {
|
|
4
|
-
constructor(mode) {
|
|
5
|
-
this._mode = mode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
static get value() {
|
|
9
|
-
return Utils.className(this.toString());
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
get value() {
|
|
13
|
-
return `${this._mode}.${this.constructor.name}`
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
get friendlyNames() {
|
|
17
|
-
return []
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get discoveryResponse() {
|
|
21
|
-
return {
|
|
22
|
-
value: this.value,
|
|
23
|
-
modeResources: {
|
|
24
|
-
friendlyNames: this.friendlyNames
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
get actionMappings() {
|
|
30
|
-
return []
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get stateMappings() {
|
|
34
|
-
return []
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
module.exports = Base;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const Base = require("./Base");
|
|
2
|
-
|
|
3
|
-
class Closed extends Base {
|
|
4
|
-
get friendlyNames() {
|
|
5
|
-
return [
|
|
6
|
-
{
|
|
7
|
-
'@type': 'asset',
|
|
8
|
-
'value': {
|
|
9
|
-
assetId: 'Alexa.Value.Close'
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
'@type': 'text',
|
|
14
|
-
value: {
|
|
15
|
-
text: 'Closed',
|
|
16
|
-
locale: 'en-US'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
'@type': 'text',
|
|
21
|
-
value: {
|
|
22
|
-
text: 'Geschloßen',
|
|
23
|
-
locale: 'de-DE'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
get actionMappings() {
|
|
30
|
-
return [
|
|
31
|
-
{
|
|
32
|
-
'@type': 'ActionsToDirective',
|
|
33
|
-
actions: ['Alexa.Actions.Close'],
|
|
34
|
-
directive: {
|
|
35
|
-
name: 'SetMode',
|
|
36
|
-
payload: {
|
|
37
|
-
mode: this.value
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
get stateMappings() {
|
|
45
|
-
return [
|
|
46
|
-
{
|
|
47
|
-
'@type': 'StatesToValue',
|
|
48
|
-
states: ['Alexa.States.Closed'],
|
|
49
|
-
value: this.value
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = Closed;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const Base = require("./Base");
|
|
2
|
-
|
|
3
|
-
class Open extends Base {
|
|
4
|
-
get friendlyNames() {
|
|
5
|
-
return [
|
|
6
|
-
{
|
|
7
|
-
'@type': 'asset',
|
|
8
|
-
value: {
|
|
9
|
-
assetId: 'Alexa.Value.Open'
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
'@type': 'text',
|
|
14
|
-
value: {
|
|
15
|
-
text: 'Open',
|
|
16
|
-
locale: 'en-US'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
'@type': 'text',
|
|
21
|
-
value: {
|
|
22
|
-
text: 'Geöffnet',
|
|
23
|
-
locale: 'de-DE'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get actionMappings() {
|
|
31
|
-
return [
|
|
32
|
-
{
|
|
33
|
-
'@type': 'ActionsToDirective',
|
|
34
|
-
actions: ['Alexa.Actions.Open'],
|
|
35
|
-
directive: {
|
|
36
|
-
name: 'SetMode',
|
|
37
|
-
payload: {
|
|
38
|
-
mode: this.value
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
get stateMappings() {
|
|
46
|
-
return [
|
|
47
|
-
{
|
|
48
|
-
'@type': 'StatesToValue',
|
|
49
|
-
states: ['Alexa.States.Open'],
|
|
50
|
-
value: this.value
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
module.exports = Open;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const modes = {};
|
|
2
|
-
const modesPath = require('path').join(__dirname);
|
|
3
|
-
const excludedNames = ['index', 'Base'];
|
|
4
|
-
|
|
5
|
-
require('fs')
|
|
6
|
-
.readdirSync(modesPath)
|
|
7
|
-
.forEach((file) => {
|
|
8
|
-
const name = file.replace(/\.js$/, '');
|
|
9
|
-
if (!excludedNames.includes(name)) {
|
|
10
|
-
modes[name] = require(`./${file}`);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
module.exports = modes;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const Utils = require('../../Helpers/Utils');
|
|
2
|
-
const Base = require('./Base');
|
|
3
|
-
|
|
4
|
-
class AdjustableProperty extends Base {
|
|
5
|
-
|
|
6
|
-
static directive(event) {
|
|
7
|
-
return event.directive.header.name === 'Adjust' + Utils.className(this.toString()) ? AdjustableProperty.ADJUST : AdjustableProperty.SET;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = AdjustableProperty;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
const Utils = require('../../Helpers/Utils');
|
|
2
|
-
|
|
3
|
-
class Base {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param {Object} opts - The object to initialize the corresponding ioBroker state.
|
|
7
|
-
* @param {Object} opts.setState - The iobroker state to write values to.
|
|
8
|
-
* @param {Object} [opts.getState] - The iobroker state to read values from.
|
|
9
|
-
* @param {function} [opts.alexaSetter] - The function to apply to an Alexa value to transform it to the iobroker's one
|
|
10
|
-
* @param {function} [opts.alexaGetter] - The function to apply to an iobroker value to transform it to the Alexa's one
|
|
11
|
-
*/
|
|
12
|
-
init(opts) {
|
|
13
|
-
this._setState = opts.setState;
|
|
14
|
-
this._setId = opts.setState.id;
|
|
15
|
-
this._getId = opts.getState?.id || this._setId;
|
|
16
|
-
this._valuesRange = Utils.configuredRangeOrDefault(this._setState);
|
|
17
|
-
|
|
18
|
-
if (opts.alexaSetter) {
|
|
19
|
-
this._alexaSetter = opts.alexaSetter;
|
|
20
|
-
}
|
|
21
|
-
if (opts.alexaGetter) {
|
|
22
|
-
this._alexaGetter = opts.alexaGetter;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get propertyName() {
|
|
27
|
-
return Utils.firstLower(`${this.constructor.name}`);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static get propertyName() {
|
|
31
|
-
return Utils.firstLower(Utils.className(this.toString()));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get valuesRangeMin() {
|
|
35
|
-
return this._valuesRange.min
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
get valuesRangeMax() {
|
|
39
|
-
return this._valuesRange.max;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
get setId() {
|
|
43
|
-
return this._setId;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get getId() {
|
|
47
|
-
return this._getId;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* returns last known iobroker value
|
|
51
|
-
*/
|
|
52
|
-
get currentValue() {
|
|
53
|
-
return this._currentValue;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
set currentValue(value) {
|
|
57
|
-
this._currentValue = value;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @param {any} alexaValue
|
|
62
|
-
*/
|
|
63
|
-
value(alexaValue) {
|
|
64
|
-
return this._alexaSetter ? this._alexaSetter(alexaValue) : alexaValue;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @param {any} value
|
|
69
|
-
*/
|
|
70
|
-
alexaValue(value) {
|
|
71
|
-
return this._alexaGetter ? this._alexaGetter(value) : value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Checks whether a directive refers to the property
|
|
76
|
-
* @param event Contains the Alexa event.
|
|
77
|
-
* @returns {boolean}
|
|
78
|
-
*/
|
|
79
|
-
static matches(event) {
|
|
80
|
-
return event?.directive?.header?.namespace === `Alexa.${Utils.className(this.toString())}Controller`;
|
|
81
|
-
// return event?.directive?.header?.name === this.propertyName;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
matches(event) {
|
|
85
|
-
return event?.directive?.header?.name === this.propertyName;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Extracts value to be set on the smart device sent in an Alexa directive
|
|
90
|
-
* @returns {object}
|
|
91
|
-
*/
|
|
92
|
-
alexaDirectiveValue(event) {
|
|
93
|
-
return event.directive.payload[this.propertyName];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
reportValue(value) {
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
static get ADJUST() { return 'ADJUST'; }
|
|
101
|
-
|
|
102
|
-
static get SET() { return 'SET'; }
|
|
103
|
-
|
|
104
|
-
static get CELSIUS_SCALE() { return 'CELSIUS'; }
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
module.exports = Base;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const AdjustableProperty = require('./AdjustableProperty');
|
|
2
|
-
|
|
3
|
-
class Brightness extends AdjustableProperty {
|
|
4
|
-
|
|
5
|
-
matches(event) {
|
|
6
|
-
return Brightness.matches(event);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
alexaDirectiveValue(event) {
|
|
10
|
-
return Brightness.directive(event) === Brightness.SET ? super.alexaDirectiveValue(event) : event.directive.payload['brightnessDelta'];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = Brightness;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const Base = require('./Base');
|
|
2
|
-
|
|
3
|
-
class Color extends Base {
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
|
-
this.hal = {
|
|
8
|
-
hue: 0,
|
|
9
|
-
saturation: 0,
|
|
10
|
-
brightness: 0,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
init(opts) {
|
|
15
|
-
this.hal = opts.hal;
|
|
16
|
-
this._setId = opts.hal.hue;
|
|
17
|
-
this._getId = opts.hal.hue;
|
|
18
|
-
|
|
19
|
-
if (opts.alexaSetter) {
|
|
20
|
-
this._alexaSetter = opts.alexaSetter;
|
|
21
|
-
}
|
|
22
|
-
if (opts.alexaGetter) {
|
|
23
|
-
this._alexaGetter = opts.alexaGetter;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
matches(event) {
|
|
28
|
-
return Color.matches(event) && event?.directive?.header?.name === 'SetColor';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
set hal(value) {
|
|
32
|
-
this._hal = value;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
get hal() {
|
|
36
|
-
return this._hal;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
module.exports = Color;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const Base = require('./Base');
|
|
2
|
-
|
|
3
|
-
class DetectionState extends Base {
|
|
4
|
-
static matches(event) {
|
|
5
|
-
return event?.directive?.header?.namespace === 'Alexa.MotionSensor' ||
|
|
6
|
-
event?.directive?.header?.namespace === 'Alexa.ContactSensor';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
matches(event) {
|
|
10
|
-
return DetectionState.matches(event);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
static get DETECTED() {
|
|
14
|
-
return 'DETECTED';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static get NOT_DETECTED() {
|
|
18
|
-
return 'NOT_DETECTED';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = DetectionState;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const Base = require('./Base');
|
|
2
|
-
|
|
3
|
-
class Mode extends Base {
|
|
4
|
-
|
|
5
|
-
init(opts) {
|
|
6
|
-
super.init(opts);
|
|
7
|
-
this._supportedModes = opts.supportedModes;
|
|
8
|
-
this._instance = opts.instance;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
matches(event) {
|
|
12
|
-
return Mode.matches(event)
|
|
13
|
-
// non-adjustable mode controller
|
|
14
|
-
&& 'SetMode' === event?.directive?.header?.name
|
|
15
|
-
&& this.instance === event?.directive?.header?.instance
|
|
16
|
-
&& this.supportedModes.map(mode => mode.value).includes(event?.directive?.payload?.mode);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
alexaDirectiveValue(event) {
|
|
20
|
-
return event.directive.payload.mode;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
get supportedModes() {
|
|
24
|
-
return this._supportedModes;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get instance() {
|
|
28
|
-
return this._instance;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = Mode;
|