iobroker.iot 4.0.1 → 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 +1 -1
- package/admin/assets/index-5zouxn2w.js +680 -0
- package/admin/index_m.html +1 -1
- package/admin/rules/assets/{ActionVisu-DE8dgNVF.js → ActionVisu-D9x2f6zu.js} +1 -1
- package/admin/rules/assets/{ActionVisu__loadShare__react__loadShare__-BKaC-p5K.js → ActionVisu__loadShare__react__loadShare__-Cg21Ef1U.js} +1 -1
- package/admin/rules/assets/{ActionVisu__loadShare__react_mf_2_dom__loadShare__-Bs1o8DtQ.js → ActionVisu__loadShare__react_mf_2_dom__loadShare__-B1zRWn0u.js} +2 -2
- package/admin/rules/assets/ActionVisu__mf_v__runtimeInit__mf_v__-Cz053nO7.js +10 -0
- package/admin/rules/assets/bootstrap-BCFKIiwZ.js +1 -0
- package/admin/rules/assets/hostInit-hos3Txsy.js +1 -1
- package/admin/rules/assets/{index-DjPMvPni.js → index-CAAeiKCc.js} +2 -2
- package/admin/rules/assets/{index-CbxmbJvB.js → index-Duo7mFlZ.js} +2 -2
- package/admin/rules/assets/index-DwYdaT5M.js +1151 -0
- package/admin/rules/assets/{virtualExposes-BNZJTatg.js → virtualExposes-BqVak7rX.js} +2 -2
- package/admin/rules/customRuleBlocks.js +2 -2
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js +268 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js.map +1 -0
- package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Base.js +110 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.js +68 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.js +82 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/ReportState.js +47 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.js +53 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.js +37 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.js +25 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Controls/Control.js +321 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Controls/Light.js +47 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Device.js +83 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Helpers/AdapterProvider.js +37 -0
- 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/build-backend/lib/AlexaSmartHomeV3/Helpers/IotProxy.js +27 -0
- 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/build-backend/lib/alexaSmartHomeV2.js +2788 -0
- package/build-backend/lib/alexaSmartHomeV3.js +97 -0
- package/build-backend/lib/alexaSmartHomeV3.js.map +1 -0
- package/build-backend/lib/alisa.js +2409 -0
- package/build-backend/lib/devices.js +23 -0
- package/build-backend/lib/devices.js.map +1 -0
- package/build-backend/lib/functions.js +24 -0
- package/build-backend/lib/functions.js.map +1 -0
- package/build-backend/lib/googleHome.js +3322 -0
- package/build-backend/lib/notifications.js +30 -0
- package/build-backend/lib/notifications.js.map +1 -0
- package/build-backend/lib/remote.js +1342 -0
- package/build-backend/lib/remote.js.map +1 -0
- package/build-backend/lib/rooms.js +48 -0
- package/build-backend/lib/rooms.js.map +1 -0
- package/build-backend/lib/texts.js +81 -0
- 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/build-backend/lib/visuApp.js +147 -0
- 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 +2 -2
- package/package.json +2 -2
- package/admin/assets/index-Y479CE6x.js +0 -681
- package/admin/rules/assets/ActionVisu__mf_v__runtimeInit__mf_v__-DtUoI3FU.js +0 -5
- package/admin/rules/assets/bootstrap-Ba57tu25.js +0 -1
- package/admin/rules/assets/index-_Y2FN5EZ.js +0 -1152
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class Open extends Base_1.default {
|
|
8
|
+
get friendlyNames() {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
'@type': 'asset',
|
|
12
|
+
value: {
|
|
13
|
+
assetId: 'Alexa.Value.Open',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
'@type': 'text',
|
|
18
|
+
value: {
|
|
19
|
+
text: 'Opened',
|
|
20
|
+
locale: 'en-US',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
'@type': 'text',
|
|
25
|
+
value: {
|
|
26
|
+
text: 'Geöffnet',
|
|
27
|
+
locale: 'de-DE',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
get actionMappings() {
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
'@type': 'ActionsToDirective',
|
|
36
|
+
actions: ['Alexa.Actions.Open'],
|
|
37
|
+
directive: {
|
|
38
|
+
name: 'SetMode',
|
|
39
|
+
payload: {
|
|
40
|
+
mode: this.value,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
get stateMappings() {
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
'@type': 'StatesToValue',
|
|
50
|
+
states: ['Alexa.States.Open'],
|
|
51
|
+
value: this.value,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = Open;
|
|
57
|
+
//# sourceMappingURL=Open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Open.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,MAAqB,IAAK,SAAQ,cAAI;IAClC,IAAI,aAAa;QACb,OAAO;YACH;gBACI,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE;oBACH,OAAO,EAAE,kBAAkB;iBAC9B;aACJ;YACD;gBACI,OAAO,EAAE,MAAM;gBACf,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO;iBAClB;aACJ;YACD;gBACI,OAAO,EAAE,MAAM;gBACf,KAAK,EAAE;oBACH,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,OAAO;iBAClB;aACJ;SACJ,CAAC;IACN,CAAC;IAED,IAAI,cAAc;QACd,OAAO;YACH;gBACI,OAAO,EAAE,oBAAoB;gBAC7B,OAAO,EAAE,CAAC,oBAAoB,CAAC;gBAC/B,SAAS,EAAE;oBACP,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACL,IAAI,EAAE,IAAI,CAAC,KAAK;qBACnB;iBACJ;aACJ;SACJ,CAAC;IACN,CAAC;IAED,IAAI,aAAa;QACb,OAAO;YACH;gBACI,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,CAAC,mBAAmB,CAAC;gBAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;aACpB;SACJ,CAAC;IACN,CAAC;CACJ;AAlDD,uBAkDC","sourcesContent":["import Base from './Base';\nimport type { AlexaV3ActionMapping, AlexaV3FriendlyName, AlexaV3StateMapping } from '../../types';\n\nexport default class Open extends Base {\n get friendlyNames(): AlexaV3FriendlyName[] {\n return [\n {\n '@type': 'asset',\n value: {\n assetId: 'Alexa.Value.Open',\n },\n },\n {\n '@type': 'text',\n value: {\n text: 'Opened',\n locale: 'en-US',\n },\n },\n {\n '@type': 'text',\n value: {\n text: 'Geöffnet',\n locale: 'de-DE',\n },\n },\n ];\n }\n\n get actionMappings(): AlexaV3ActionMapping[] {\n return [\n {\n '@type': 'ActionsToDirective',\n actions: ['Alexa.Actions.Open'],\n directive: {\n name: 'SetMode',\n payload: {\n mode: this.value,\n },\n },\n },\n ];\n }\n\n get stateMappings(): AlexaV3StateMapping[] {\n return [\n {\n '@type': 'StatesToValue',\n states: ['Alexa.States.Open'],\n value: this.value,\n },\n ];\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Open_1 = __importDefault(require("./Open"));
|
|
7
|
+
const Closed_1 = __importDefault(require("./Closed"));
|
|
8
|
+
exports.default = {
|
|
9
|
+
Closed: Closed_1.default,
|
|
10
|
+
Open: Open_1.default,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,sDAA8B;AAE9B,kBAAe;IACX,MAAM,EAAN,gBAAM;IACN,IAAI,EAAJ,cAAI;CACP,CAAC","sourcesContent":["import Open from './Open';\nimport Closed from './Closed';\n\nexport default {\n Closed,\n Open,\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Utils_1 = require("../../Helpers/Utils");
|
|
7
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
8
|
+
class AdjustableProperty extends Base_1.default {
|
|
9
|
+
static directive(event) {
|
|
10
|
+
return event.directive.header.name === `Adjust${(0, Utils_1.className)(this.toString())}`
|
|
11
|
+
? AdjustableProperty.ADJUST
|
|
12
|
+
: AdjustableProperty.SET;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = AdjustableProperty;
|
|
16
|
+
//# sourceMappingURL=AdjustableProperty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdjustableProperty.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgD;AAChD,kDAA0B;AAG1B,MAAqB,kBAAmB,SAAQ,cAAI;IAChD,MAAM,CAAC,SAAS,CAAC,KAAqB;QAClC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAA,iBAAS,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE;YACxE,CAAC,CAAC,kBAAkB,CAAC,MAAM;YAC3B,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC;IACjC,CAAC;CACJ;AAND,qCAMC","sourcesContent":["import { className } from '../../Helpers/Utils';\nimport Base from './Base';\nimport type { AlexaV3DirectiveName, AlexaV3Request } from '../../types';\n\nexport default class AdjustableProperty extends Base {\n static directive(event: AlexaV3Request): AlexaV3DirectiveName {\n return event.directive.header.name === `Adjust${className(this.toString())}`\n ? AdjustableProperty.ADJUST\n : AdjustableProperty.SET;\n }\n}\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Base = void 0;
|
|
4
|
+
const Utils_1 = require("../../Helpers/Utils");
|
|
5
|
+
class Base {
|
|
6
|
+
_properties = [];
|
|
7
|
+
_setState = null;
|
|
8
|
+
_setId = '';
|
|
9
|
+
_getId = '';
|
|
10
|
+
_valuesRange = { min: 0, max: 100 };
|
|
11
|
+
_currentValue;
|
|
12
|
+
_alexaSetter;
|
|
13
|
+
_alexaGetter;
|
|
14
|
+
_instance;
|
|
15
|
+
_supportedModesAsEnum = {};
|
|
16
|
+
/**
|
|
17
|
+
* @param opts The object to initialize the corresponding ioBroker state.
|
|
18
|
+
* @param opts.setState The iobroker state to write values to.
|
|
19
|
+
* @param opts.getState The iobroker state to read values from.
|
|
20
|
+
* @param opts.alexaSetter The function to apply to an Alexa value to transform it to the iobroker's one
|
|
21
|
+
* @param opts.alexaGetter The function to apply to an iobroker value to transform it to the Alexa's one
|
|
22
|
+
*/
|
|
23
|
+
init(opts) {
|
|
24
|
+
if (!opts.setState) {
|
|
25
|
+
throw new Error(`missing setState in ${this.constructor.name}`);
|
|
26
|
+
}
|
|
27
|
+
this._setState = opts.setState;
|
|
28
|
+
this._setId = opts.setState.id;
|
|
29
|
+
this._getId = opts.getState?.id || this._setId;
|
|
30
|
+
this._valuesRange = (0, Utils_1.configuredRangeOrDefault)(this._setState);
|
|
31
|
+
this._instance = opts.instance;
|
|
32
|
+
if (opts.alexaSetter) {
|
|
33
|
+
this._alexaSetter = opts.alexaSetter;
|
|
34
|
+
}
|
|
35
|
+
if (opts.alexaGetter) {
|
|
36
|
+
this._alexaGetter = opts.alexaGetter;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
get instance() {
|
|
40
|
+
return this._instance;
|
|
41
|
+
}
|
|
42
|
+
get propertyName() {
|
|
43
|
+
return (0, Utils_1.firstLower)(`${this.constructor.name}`);
|
|
44
|
+
}
|
|
45
|
+
static get propertyName() {
|
|
46
|
+
return (0, Utils_1.firstLower)((0, Utils_1.className)(this.toString()));
|
|
47
|
+
}
|
|
48
|
+
get valuesRangeMin() {
|
|
49
|
+
return this._valuesRange.min;
|
|
50
|
+
}
|
|
51
|
+
get valuesRangeMax() {
|
|
52
|
+
return this._valuesRange.max;
|
|
53
|
+
}
|
|
54
|
+
get setId() {
|
|
55
|
+
return this._setId;
|
|
56
|
+
}
|
|
57
|
+
get getId() {
|
|
58
|
+
return this._getId;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* returns last known iobroker value
|
|
62
|
+
*/
|
|
63
|
+
get currentValue() {
|
|
64
|
+
return this._currentValue;
|
|
65
|
+
}
|
|
66
|
+
set currentValue(value) {
|
|
67
|
+
this._currentValue = value;
|
|
68
|
+
}
|
|
69
|
+
value(alexaValue) {
|
|
70
|
+
return this._alexaSetter && typeof alexaValue === 'number'
|
|
71
|
+
? this._alexaSetter(alexaValue)
|
|
72
|
+
: alexaValue;
|
|
73
|
+
}
|
|
74
|
+
alexaValue(value) {
|
|
75
|
+
return this._alexaGetter && typeof value === 'number'
|
|
76
|
+
? this._alexaGetter(value)
|
|
77
|
+
: value;
|
|
78
|
+
}
|
|
79
|
+
static directive(_event) {
|
|
80
|
+
return Base.SET;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Checks whether a directive refers to the property
|
|
84
|
+
*
|
|
85
|
+
* @param event Contains the Alexa event.
|
|
86
|
+
*/
|
|
87
|
+
static matches(event) {
|
|
88
|
+
return event?.directive?.header?.namespace === `Alexa.${(0, Utils_1.className)(this.toString())}Controller`;
|
|
89
|
+
}
|
|
90
|
+
matches(event) {
|
|
91
|
+
return event?.directive?.header?.name === this.propertyName;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Extracts value to be set on the smart device sent in an Alexa directive
|
|
95
|
+
*/
|
|
96
|
+
alexaDirectiveValue(event) {
|
|
97
|
+
if (this.propertyName === 'color') {
|
|
98
|
+
return event.directive.payload.color;
|
|
99
|
+
}
|
|
100
|
+
if (this.propertyName === 'colorTemperatureInKelvin') {
|
|
101
|
+
return event.directive.payload.colorTemperatureInKelvin;
|
|
102
|
+
}
|
|
103
|
+
if (this.propertyName === 'brightness') {
|
|
104
|
+
return event.directive.payload.brightness;
|
|
105
|
+
}
|
|
106
|
+
// @ts-expect-error fix later
|
|
107
|
+
return event.directive.payload[this.propertyName];
|
|
108
|
+
}
|
|
109
|
+
reportValue(value) {
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
static get ADJUST() {
|
|
113
|
+
return 'ADJUST';
|
|
114
|
+
}
|
|
115
|
+
static get SET() {
|
|
116
|
+
return 'SET';
|
|
117
|
+
}
|
|
118
|
+
static get CELSIUS_SCALE() {
|
|
119
|
+
return 'CELSIUS';
|
|
120
|
+
}
|
|
121
|
+
get supportedModesAsEnum() {
|
|
122
|
+
return this._supportedModesAsEnum;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.Base = Base;
|
|
126
|
+
exports.default = Base;
|
|
127
|
+
//# sourceMappingURL=Base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/Base.ts"],"names":[],"mappings":"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","sourcesContent":["import { configuredRangeOrDefault, firstLower, className } from '../../Helpers/Utils';\nimport type {\n AlexaV3DirectiveName,\n AlexaV3DirectiveValue,\n AlexaV3Request,\n IotExternalDetectorState,\n} from '../../types';\n\nexport type ControlStateInitObject = {\n setState?: IotExternalDetectorState;\n getState?: IotExternalDetectorState;\n alexaSetter?: (alexaValue: AlexaV3DirectiveValue) => ioBroker.StateValue | undefined;\n alexaGetter?: (value: ioBroker.StateValue | undefined) => AlexaV3DirectiveValue;\n\n // Extra for Color control\n hal?: {\n hue: string;\n saturation?: string;\n brightness?: string;\n };\n\n // Extra for Mode control\n supportedModes?: any[];\n instance?: string;\n};\n\nexport class Base {\n private _properties: string[] = [];\n private _setState: IotExternalDetectorState | null = null;\n protected _setId: string = '';\n protected _getId: string = '';\n private _valuesRange: { min: number | boolean; max: number | boolean } = { min: 0, max: 100 };\n private _currentValue: ioBroker.StateValue | undefined;\n protected _alexaSetter?: (value: AlexaV3DirectiveValue) => ioBroker.StateValue | undefined;\n protected _alexaGetter?: (value: ioBroker.StateValue | undefined) => AlexaV3DirectiveValue;\n private _instance?: string;\n protected _supportedModesAsEnum: Record<string, number | string> = {};\n\n /**\n * @param opts The object to initialize the corresponding ioBroker state.\n * @param opts.setState The iobroker state to write values to.\n * @param opts.getState The iobroker state to read values from.\n * @param opts.alexaSetter The function to apply to an Alexa value to transform it to the iobroker's one\n * @param opts.alexaGetter The function to apply to an iobroker value to transform it to the Alexa's one\n */\n init(opts: ControlStateInitObject): void {\n if (!opts.setState) {\n throw new Error(`missing setState in ${this.constructor.name}`);\n }\n this._setState = opts.setState;\n this._setId = opts.setState.id;\n this._getId = opts.getState?.id || this._setId;\n this._valuesRange = configuredRangeOrDefault(this._setState);\n this._instance = opts.instance;\n\n if (opts.alexaSetter) {\n this._alexaSetter = opts.alexaSetter;\n }\n if (opts.alexaGetter) {\n this._alexaGetter = opts.alexaGetter;\n }\n }\n\n get instance(): string | undefined {\n return this._instance;\n }\n\n get propertyName(): string {\n return firstLower(`${this.constructor.name}`);\n }\n\n static get propertyName(): string {\n return firstLower(className(this.toString()));\n }\n\n get valuesRangeMin(): number | boolean {\n return this._valuesRange.min;\n }\n\n get valuesRangeMax(): number | boolean {\n return this._valuesRange.max;\n }\n\n get setId(): string {\n return this._setId;\n }\n\n get getId(): string {\n return this._getId;\n }\n /**\n * returns last known iobroker value\n */\n get currentValue(): ioBroker.StateValue | undefined {\n return this._currentValue;\n }\n\n set currentValue(value: ioBroker.StateValue | undefined) {\n this._currentValue = value;\n }\n\n value(alexaValue: AlexaV3DirectiveValue): ioBroker.StateValue | undefined {\n return this._alexaSetter && typeof alexaValue === 'number'\n ? this._alexaSetter(alexaValue)\n : (alexaValue as ioBroker.StateValue | undefined);\n }\n\n alexaValue(value: ioBroker.StateValue | undefined): AlexaV3DirectiveValue {\n return this._alexaGetter && typeof value === 'number'\n ? this._alexaGetter(value)\n : (value as AlexaV3DirectiveValue);\n }\n\n static directive(_event: AlexaV3Request): AlexaV3DirectiveName {\n return Base.SET;\n }\n\n /**\n * Checks whether a directive refers to the property\n *\n * @param event Contains the Alexa event.\n */\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.namespace === `Alexa.${className(this.toString())}Controller`;\n }\n\n matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.name === this.propertyName;\n }\n\n /**\n * Extracts value to be set on the smart device sent in an Alexa directive\n */\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n if (this.propertyName === 'color') {\n return event.directive.payload.color;\n }\n if (this.propertyName === 'colorTemperatureInKelvin') {\n return event.directive.payload.colorTemperatureInKelvin;\n }\n if (this.propertyName === 'brightness') {\n return event.directive.payload.brightness;\n }\n // @ts-expect-error fix later\n return event.directive.payload[this.propertyName];\n }\n\n reportValue(value: AlexaV3DirectiveValue): any {\n return value;\n }\n\n static get ADJUST(): AlexaV3DirectiveName {\n return 'ADJUST';\n }\n\n static get SET(): AlexaV3DirectiveName {\n return 'SET';\n }\n\n static get CELSIUS_SCALE(): AlexaV3DirectiveName {\n return 'CELSIUS';\n }\n\n get supportedModesAsEnum(): Record<string, number | string> {\n return this._supportedModesAsEnum;\n }\n}\n\nexport default Base;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AdjustableProperty_1 = __importDefault(require("./AdjustableProperty"));
|
|
7
|
+
class Brightness extends AdjustableProperty_1.default {
|
|
8
|
+
matches(event) {
|
|
9
|
+
return Brightness.matches(event);
|
|
10
|
+
}
|
|
11
|
+
alexaDirectiveValue(event) {
|
|
12
|
+
return Brightness.directive(event) === Brightness.SET
|
|
13
|
+
? super.alexaDirectiveValue(event)
|
|
14
|
+
: event.directive.payload.brightnessDelta;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = Brightness;
|
|
18
|
+
//# sourceMappingURL=Brightness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Brightness.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AAGtD,MAAqB,UAAW,SAAQ,4BAAkB;IACtD,OAAO,CAAC,KAAqB;QACzB,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,GAAG;YACjD,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC;YAClC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC;IAClD,CAAC;CACJ;AAVD,6BAUC","sourcesContent":["import AdjustableProperty from './AdjustableProperty';\nimport type { AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\n\nexport default class Brightness extends AdjustableProperty {\n matches(event: AlexaV3Request): boolean {\n return Brightness.matches(event);\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return Brightness.directive(event) === Brightness.SET\n ? super.alexaDirectiveValue(event)\n : event.directive.payload.brightnessDelta;\n }\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class Color extends Base_1.default {
|
|
8
|
+
_hal = {
|
|
9
|
+
hue: '',
|
|
10
|
+
saturation: '',
|
|
11
|
+
brightness: '',
|
|
12
|
+
};
|
|
13
|
+
init(opts) {
|
|
14
|
+
if (!opts.hal) {
|
|
15
|
+
throw new Error('Color control requires hal object with hue, saturation, and brightness properties');
|
|
16
|
+
}
|
|
17
|
+
this.hal = opts.hal;
|
|
18
|
+
this._setId = opts.hal.hue;
|
|
19
|
+
this._getId = opts.hal.hue;
|
|
20
|
+
if (opts.alexaSetter) {
|
|
21
|
+
this._alexaSetter = opts.alexaSetter;
|
|
22
|
+
}
|
|
23
|
+
if (opts.alexaGetter) {
|
|
24
|
+
this._alexaGetter = opts.alexaGetter;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
matches(event) {
|
|
28
|
+
return Color.matches(event) && event?.directive?.header?.name === 'SetColor';
|
|
29
|
+
}
|
|
30
|
+
set hal(value) {
|
|
31
|
+
this._hal = value;
|
|
32
|
+
}
|
|
33
|
+
get hal() {
|
|
34
|
+
return this._hal;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = Color;
|
|
38
|
+
//# sourceMappingURL=Color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Color.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/Color.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2D;AAG3D,MAAqB,KAAM,SAAQ,cAAI;IAC3B,IAAI,GAIR;QACA,GAAG,EAAE,EAAE;QACP,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;KACjB,CAAC;IAEF,IAAI,CAAC,IAA4B;QAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,mFAAmF,CAAC,CAAC;QACzG,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAE3B,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QACzC,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QACzC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,KAAK,UAAU,CAAC;IACjF,CAAC;IAED,IAAI,GAAG,CAAC,KAAgE;QACpE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,GAAG;QAKH,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ;AA1CD,wBA0CC","sourcesContent":["import Base, { type ControlStateInitObject } from './Base';\nimport type { AlexaV3Request } from '../../types';\n\nexport default class Color extends Base {\n private _hal: {\n hue: string;\n saturation?: string;\n brightness?: string;\n } = {\n hue: '',\n saturation: '',\n brightness: '',\n };\n\n init(opts: ControlStateInitObject): void {\n if (!opts.hal) {\n throw new Error('Color control requires hal object with hue, saturation, and brightness properties');\n }\n this.hal = opts.hal;\n this._setId = opts.hal.hue;\n this._getId = opts.hal.hue;\n\n if (opts.alexaSetter) {\n this._alexaSetter = opts.alexaSetter;\n }\n if (opts.alexaGetter) {\n this._alexaGetter = opts.alexaGetter;\n }\n }\n\n matches(event: AlexaV3Request): boolean {\n return Color.matches(event) && event?.directive?.header?.name === 'SetColor';\n }\n\n set hal(value: { hue: string; saturation?: string; brightness?: string }) {\n this._hal = value;\n }\n\n get hal(): {\n hue: string;\n saturation?: string;\n brightness?: string;\n } {\n return this._hal;\n }\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AdjustableProperty_1 = __importDefault(require("./AdjustableProperty"));
|
|
7
|
+
class ColorTemperatureInKelvin extends AdjustableProperty_1.default {
|
|
8
|
+
static _colorTemperatureTable = [2200, 2700, 4000, 5500, 7000];
|
|
9
|
+
static matches(event) {
|
|
10
|
+
return event?.directive?.header?.namespace === 'Alexa.ColorTemperatureController';
|
|
11
|
+
}
|
|
12
|
+
static directive(event) {
|
|
13
|
+
return [
|
|
14
|
+
ColorTemperatureInKelvin.INCREASE_COLOR_TEMPERATURE,
|
|
15
|
+
ColorTemperatureInKelvin.DECREASE_COLOR_TEMPERATURE,
|
|
16
|
+
].includes(event?.directive?.header?.name)
|
|
17
|
+
? AdjustableProperty_1.default.ADJUST
|
|
18
|
+
: AdjustableProperty_1.default.SET;
|
|
19
|
+
}
|
|
20
|
+
matches(event) {
|
|
21
|
+
return (ColorTemperatureInKelvin.matches(event) &&
|
|
22
|
+
[
|
|
23
|
+
ColorTemperatureInKelvin.SET_COLOR_TEMPERATURE,
|
|
24
|
+
ColorTemperatureInKelvin.INCREASE_COLOR_TEMPERATURE,
|
|
25
|
+
ColorTemperatureInKelvin.DECREASE_COLOR_TEMPERATURE,
|
|
26
|
+
].includes(event?.directive?.header?.name));
|
|
27
|
+
}
|
|
28
|
+
get colorTemperatureTable() {
|
|
29
|
+
return ColorTemperatureInKelvin._colorTemperatureTable;
|
|
30
|
+
}
|
|
31
|
+
alexaDirectiveValue(event) {
|
|
32
|
+
if (ColorTemperatureInKelvin.SET_COLOR_TEMPERATURE === event?.directive?.header?.name) {
|
|
33
|
+
return super.alexaDirectiveValue(event);
|
|
34
|
+
}
|
|
35
|
+
if (ColorTemperatureInKelvin.INCREASE_COLOR_TEMPERATURE === event?.directive?.header?.name) {
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
if (ColorTemperatureInKelvin.DECREASE_COLOR_TEMPERATURE === event?.directive?.header?.name) {
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static get SET_COLOR_TEMPERATURE() {
|
|
43
|
+
return 'SetColorTemperature';
|
|
44
|
+
}
|
|
45
|
+
static get INCREASE_COLOR_TEMPERATURE() {
|
|
46
|
+
return 'IncreaseColorTemperature';
|
|
47
|
+
}
|
|
48
|
+
static get DECREASE_COLOR_TEMPERATURE() {
|
|
49
|
+
return 'DecreaseColorTemperature';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = ColorTemperatureInKelvin;
|
|
53
|
+
//# sourceMappingURL=ColorTemperatureInKelvin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorTemperatureInKelvin.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AAGtD,MAAqB,wBAAyB,SAAQ,4BAAkB;IACpE,MAAM,CAAC,sBAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAE/D,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,kCAAkC,CAAC;IACtF,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,KAAqB;QAClC,OAAO;YACH,wBAAwB,CAAC,0BAA0B;YACnD,wBAAwB,CAAC,0BAA0B;SACtD,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC;YACtC,CAAC,CAAC,4BAAkB,CAAC,MAAM;YAC3B,CAAC,CAAC,4BAAkB,CAAC,GAAG,CAAC;IACjC,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,CACH,wBAAwB,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC;gBACI,wBAAwB,CAAC,qBAAqB;gBAC9C,wBAAwB,CAAC,0BAA0B;gBACnD,wBAAwB,CAAC,0BAA0B;aACtD,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAC7C,CAAC;IACN,CAAC;IAED,IAAI,qBAAqB;QACrB,OAAO,wBAAwB,CAAC,sBAAsB,CAAC;IAC3D,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,IAAI,wBAAwB,CAAC,qBAAqB,KAAK,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACpF,OAAO,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,wBAAwB,CAAC,0BAA0B,KAAK,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACzF,OAAO,CAAC,CAAC;QACb,CAAC;QAED,IAAI,wBAAwB,CAAC,0BAA0B,KAAK,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACzF,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;IACL,CAAC;IAED,MAAM,KAAK,qBAAqB;QAC5B,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAED,MAAM,KAAK,0BAA0B;QACjC,OAAO,0BAA0B,CAAC;IACtC,CAAC;IAED,MAAM,KAAK,0BAA0B;QACjC,OAAO,0BAA0B,CAAC;IACtC,CAAC;;AAvDL,2CAwDC","sourcesContent":["import AdjustableProperty from './AdjustableProperty';\nimport type { AlexaV3DirectiveName, AlexaV3DirectiveType, AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\n\nexport default class ColorTemperatureInKelvin extends AdjustableProperty {\n static _colorTemperatureTable = [2200, 2700, 4000, 5500, 7000];\n\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.namespace === 'Alexa.ColorTemperatureController';\n }\n\n static directive(event: AlexaV3Request): AlexaV3DirectiveName {\n return [\n ColorTemperatureInKelvin.INCREASE_COLOR_TEMPERATURE,\n ColorTemperatureInKelvin.DECREASE_COLOR_TEMPERATURE,\n ].includes(event?.directive?.header?.name)\n ? AdjustableProperty.ADJUST\n : AdjustableProperty.SET;\n }\n\n matches(event: AlexaV3Request): boolean {\n return (\n ColorTemperatureInKelvin.matches(event) &&\n [\n ColorTemperatureInKelvin.SET_COLOR_TEMPERATURE,\n ColorTemperatureInKelvin.INCREASE_COLOR_TEMPERATURE,\n ColorTemperatureInKelvin.DECREASE_COLOR_TEMPERATURE,\n ].includes(event?.directive?.header?.name)\n );\n }\n\n get colorTemperatureTable(): number[] {\n return ColorTemperatureInKelvin._colorTemperatureTable;\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n if (ColorTemperatureInKelvin.SET_COLOR_TEMPERATURE === event?.directive?.header?.name) {\n return super.alexaDirectiveValue(event);\n }\n\n if (ColorTemperatureInKelvin.INCREASE_COLOR_TEMPERATURE === event?.directive?.header?.name) {\n return 1;\n }\n\n if (ColorTemperatureInKelvin.DECREASE_COLOR_TEMPERATURE === event?.directive?.header?.name) {\n return -1;\n }\n }\n\n static get SET_COLOR_TEMPERATURE(): AlexaV3DirectiveType {\n return 'SetColorTemperature';\n }\n\n static get INCREASE_COLOR_TEMPERATURE(): AlexaV3DirectiveType {\n return 'IncreaseColorTemperature';\n }\n\n static get DECREASE_COLOR_TEMPERATURE(): AlexaV3DirectiveType {\n return 'DecreaseColorTemperature';\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class DetectionState extends Base_1.default {
|
|
8
|
+
static matches(event) {
|
|
9
|
+
return (event?.directive?.header?.namespace === 'Alexa.MotionSensor' ||
|
|
10
|
+
event?.directive?.header?.namespace === 'Alexa.ContactSensor');
|
|
11
|
+
}
|
|
12
|
+
matches(event) {
|
|
13
|
+
return DetectionState.matches(event);
|
|
14
|
+
}
|
|
15
|
+
static get DETECTED() {
|
|
16
|
+
return 'DETECTED';
|
|
17
|
+
}
|
|
18
|
+
static get NOT_DETECTED() {
|
|
19
|
+
return 'NOT_DETECTED';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = DetectionState;
|
|
23
|
+
//# sourceMappingURL=DetectionState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetectionState.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,MAAqB,cAAe,SAAQ,cAAI;IAC5C,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,CACH,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,oBAAoB;YAC5D,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,qBAAqB,CAChE,CAAC;IACN,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,KAAK,QAAQ;QACf,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,MAAM,KAAK,YAAY;QACnB,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ;AAnBD,iCAmBC","sourcesContent":["import Base from './Base';\nimport type { AlexaV3DirectiveName, AlexaV3Request } from '../../types';\n\nexport default class DetectionState extends Base {\n static matches(event: AlexaV3Request): boolean {\n return (\n event?.directive?.header?.namespace === 'Alexa.MotionSensor' ||\n event?.directive?.header?.namespace === 'Alexa.ContactSensor'\n );\n }\n\n matches(event: AlexaV3Request): boolean {\n return DetectionState.matches(event);\n }\n\n static get DETECTED(): AlexaV3DirectiveName {\n return 'DETECTED';\n }\n\n static get NOT_DETECTED(): AlexaV3DirectiveName {\n return 'NOT_DETECTED';\n }\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class LockState extends Base_1.default {
|
|
8
|
+
static matches(event) {
|
|
9
|
+
return event?.directive?.header?.namespace === 'Alexa.LockController';
|
|
10
|
+
}
|
|
11
|
+
matches(event) {
|
|
12
|
+
return LockState.matches(event);
|
|
13
|
+
}
|
|
14
|
+
alexaDirectiveValue(event) {
|
|
15
|
+
return event.directive.header.name;
|
|
16
|
+
}
|
|
17
|
+
static get LOCK() {
|
|
18
|
+
return 'Lock';
|
|
19
|
+
}
|
|
20
|
+
static get LOCKED() {
|
|
21
|
+
return 'LOCKED';
|
|
22
|
+
}
|
|
23
|
+
static get UNLOCK() {
|
|
24
|
+
return 'Unlock';
|
|
25
|
+
}
|
|
26
|
+
static get UNLOCKED() {
|
|
27
|
+
return 'UNLOCKED';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The lock can't transition to `locked` or `unlocked` because the locking mechanism is jammed.
|
|
31
|
+
*/
|
|
32
|
+
static get JAMMED() {
|
|
33
|
+
return 'JAMMED';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = LockState;
|
|
37
|
+
//# sourceMappingURL=LockState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LockState.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,MAAqB,SAAU,SAAQ,cAAI;IACvC,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,sBAAsB,CAAC;IAC1E,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAyB,CAAC;IAC5D,CAAC;IAED,MAAM,KAAK,IAAI;QACX,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,MAAM;QACb,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,MAAM,KAAK,MAAM;QACb,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,MAAM,KAAK,QAAQ;QACf,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAnCD,4BAmCC","sourcesContent":["import Base from './Base';\nimport type { AlexaV3DirectiveName, AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\n\nexport default class LockState extends Base {\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.namespace === 'Alexa.LockController';\n }\n\n matches(event: AlexaV3Request): boolean {\n return LockState.matches(event);\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return event.directive.header.name as 'Lock' | 'Unlock';\n }\n\n static get LOCK(): string {\n return 'Lock';\n }\n\n static get LOCKED(): AlexaV3DirectiveName {\n return 'LOCKED';\n }\n\n static get UNLOCK(): string {\n return 'Unlock';\n }\n\n static get UNLOCKED(): AlexaV3DirectiveName {\n return 'UNLOCKED';\n }\n\n /**\n * The lock can't transition to `locked` or `unlocked` because the locking mechanism is jammed.\n */\n static get JAMMED(): AlexaV3DirectiveName {\n return 'JAMMED';\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class Mode extends Base_1.default {
|
|
8
|
+
_supportedModes = [];
|
|
9
|
+
init(opts) {
|
|
10
|
+
super.init(opts);
|
|
11
|
+
if (!opts.supportedModes || !Array.isArray(opts.supportedModes) || opts.supportedModes.length === 0) {
|
|
12
|
+
throw new Error('Mode control requires supportedModes array with at least one mode');
|
|
13
|
+
}
|
|
14
|
+
if (!opts.instance || typeof opts.instance !== 'string') {
|
|
15
|
+
throw new Error('Mode control requires a valid instance string');
|
|
16
|
+
}
|
|
17
|
+
this._supportedModes = opts.supportedModes;
|
|
18
|
+
}
|
|
19
|
+
matches(event) {
|
|
20
|
+
return (Mode.matches(event) &&
|
|
21
|
+
// non-adjustable mode controller
|
|
22
|
+
'SetMode' === event?.directive?.header?.name &&
|
|
23
|
+
this.instance === event?.directive?.header?.instance &&
|
|
24
|
+
this.supportedModes.map(mode => mode.value).includes(event?.directive?.payload?.mode || ''));
|
|
25
|
+
}
|
|
26
|
+
alexaDirectiveValue(event) {
|
|
27
|
+
return event.directive.payload.mode;
|
|
28
|
+
}
|
|
29
|
+
get supportedModes() {
|
|
30
|
+
return this._supportedModes;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = Mode;
|
|
34
|
+
//# sourceMappingURL=Mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mode.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2D;AAS3D,MAAqB,IAAK,SAAQ,cAAI;IAC1B,eAAe,GAKjB,EAAE,CAAC;IAET,IAAI,CAAC,IAA4B;QAC7B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClG,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC;IAC/C,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,CACH,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YACnB,iCAAiC;YACjC,SAAS,KAAK,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI;YAC5C,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ;YACpD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,CAC9F,CAAC;IACN,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;IACxC,CAAC;IAED,IAAI,cAAc;QAMd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;CACJ;AAzCD,uBAyCC","sourcesContent":["import Base, { type ControlStateInitObject } from './Base';\nimport type {\n AlexaV3ActionMapping,\n AlexaV3DirectiveValue,\n AlexaV3DiscoveryResponse,\n AlexaV3Request,\n AlexaV3StateMapping,\n} from '../../types';\n\nexport default class Mode extends Base {\n private _supportedModes: {\n value: string;\n actionMappings: AlexaV3ActionMapping[];\n discoveryResponse: AlexaV3DiscoveryResponse[];\n stateMappings: AlexaV3StateMapping[];\n }[] = [];\n\n init(opts: ControlStateInitObject): void {\n super.init(opts);\n if (!opts.supportedModes || !Array.isArray(opts.supportedModes) || opts.supportedModes.length === 0) {\n throw new Error('Mode control requires supportedModes array with at least one mode');\n }\n if (!opts.instance || typeof opts.instance !== 'string') {\n throw new Error('Mode control requires a valid instance string');\n }\n this._supportedModes = opts.supportedModes;\n }\n\n matches(event: AlexaV3Request): boolean {\n return (\n Mode.matches(event) &&\n // non-adjustable mode controller\n 'SetMode' === event?.directive?.header?.name &&\n this.instance === event?.directive?.header?.instance &&\n this.supportedModes.map(mode => mode.value).includes(event?.directive?.payload?.mode || '')\n );\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return event.directive.payload.mode;\n }\n\n get supportedModes(): {\n value: string;\n actionMappings: AlexaV3ActionMapping[];\n discoveryResponse: AlexaV3DiscoveryResponse[];\n stateMappings: AlexaV3StateMapping[];\n }[] {\n return this._supportedModes;\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class Muted extends Base_1.default {
|
|
8
|
+
static matches(event) {
|
|
9
|
+
return event?.directive?.header?.namespace === 'Alexa.Speaker';
|
|
10
|
+
}
|
|
11
|
+
matches(event) {
|
|
12
|
+
return Muted.matches(event) && event?.directive?.header?.name === 'SetMute';
|
|
13
|
+
}
|
|
14
|
+
alexaDirectiveValue(event) {
|
|
15
|
+
return !!event.directive.payload.mute;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = Muted;
|
|
19
|
+
//# sourceMappingURL=Muted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Muted.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,MAAqB,KAAM,SAAQ,cAAI;IACnC,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,eAAe,CAAC;IACnE,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,KAAK,SAAS,CAAC;IAChF,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1C,CAAC;CACJ;AAZD,wBAYC","sourcesContent":["import Base from './Base';\nimport type { AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\n\nexport default class Muted extends Base {\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.namespace === 'Alexa.Speaker';\n }\n\n matches(event: AlexaV3Request): boolean {\n return Muted.matches(event) && event?.directive?.header?.name === 'SetMute';\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return !!event.directive.payload.mute;\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AdjustableProperty_1 = __importDefault(require("./AdjustableProperty"));
|
|
7
|
+
class Percentage extends AdjustableProperty_1.default {
|
|
8
|
+
matches(event) {
|
|
9
|
+
return Percentage.matches(event);
|
|
10
|
+
}
|
|
11
|
+
alexaDirectiveValue(event) {
|
|
12
|
+
return Percentage.directive(event) === Percentage.SET
|
|
13
|
+
? super.alexaDirectiveValue(event)
|
|
14
|
+
: event.directive.payload.percentageDelta;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = Percentage;
|
|
18
|
+
//# sourceMappingURL=Percentage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Percentage.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.ts"],"names":[],"mappings":";;;;;AACA,8EAAsD;AAEtD,MAAqB,UAAW,SAAQ,4BAAkB;IACtD,OAAO,CAAC,KAAqB;QACzB,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,GAAG;YACjD,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC;YAClC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC;IAClD,CAAC;CACJ;AAVD,6BAUC","sourcesContent":["import type { AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\nimport AdjustableProperty from './AdjustableProperty';\n\nexport default class Percentage extends AdjustableProperty {\n matches(event: AlexaV3Request): boolean {\n return Percentage.matches(event);\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return Percentage.directive(event) === Percentage.SET\n ? super.alexaDirectiveValue(event)\n : event.directive.payload.percentageDelta;\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class PowerState extends Base_1.default {
|
|
8
|
+
static matches(event) {
|
|
9
|
+
return event?.directive?.header?.namespace === 'Alexa.PowerController';
|
|
10
|
+
}
|
|
11
|
+
matches(event) {
|
|
12
|
+
return PowerState.matches(event);
|
|
13
|
+
}
|
|
14
|
+
static get ON() {
|
|
15
|
+
return 'ON';
|
|
16
|
+
}
|
|
17
|
+
static get OFF() {
|
|
18
|
+
return 'OFF';
|
|
19
|
+
}
|
|
20
|
+
alexaDirectiveValue(event) {
|
|
21
|
+
return event.directive.header.name === 'TurnOn' ? PowerState.ON : PowerState.OFF;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = PowerState;
|
|
25
|
+
//# sourceMappingURL=PowerState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerState.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,MAAqB,UAAW,SAAQ,cAAI;IACxC,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,uBAAuB,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,KAAK,EAAE;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,KAAK,GAAG;QACV,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;IACrF,CAAC;CACJ;AApBD,6BAoBC","sourcesContent":["import Base from './Base';\nimport type { AlexaV3DirectiveName, AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\n\nexport default class PowerState extends Base {\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.namespace === 'Alexa.PowerController';\n }\n\n matches(event: AlexaV3Request): boolean {\n return PowerState.matches(event);\n }\n\n static get ON(): AlexaV3DirectiveName {\n return 'ON';\n }\n\n static get OFF(): AlexaV3DirectiveName {\n return 'OFF';\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return event.directive.header.name === 'TurnOn' ? PowerState.ON : PowerState.OFF;\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
7
|
+
class TargetSetpoint extends Base_1.default {
|
|
8
|
+
static matches(event) {
|
|
9
|
+
return (event?.directive?.header?.name === 'SetTargetTemperature' ||
|
|
10
|
+
event?.directive?.header?.name === 'AdjustTargetTemperature');
|
|
11
|
+
}
|
|
12
|
+
matches(event) {
|
|
13
|
+
return TargetSetpoint.matches(event);
|
|
14
|
+
}
|
|
15
|
+
static directive(event) {
|
|
16
|
+
return event.directive.header.name === 'AdjustTargetTemperature' ? TargetSetpoint.ADJUST : TargetSetpoint.SET;
|
|
17
|
+
}
|
|
18
|
+
alexaDirectiveValue(event) {
|
|
19
|
+
return TargetSetpoint.directive(event) === TargetSetpoint.SET
|
|
20
|
+
? event.directive.payload.targetSetpoint.value
|
|
21
|
+
: event.directive.payload.targetSetpointDelta.value;
|
|
22
|
+
}
|
|
23
|
+
reportValue(value) {
|
|
24
|
+
return {
|
|
25
|
+
value,
|
|
26
|
+
scale: TargetSetpoint.CELSIUS_SCALE,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = TargetSetpoint;
|
|
31
|
+
//# sourceMappingURL=TargetSetpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TargetSetpoint.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,MAAqB,cAAe,SAAQ,cAAI;IAC5C,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,CACH,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,KAAK,sBAAsB;YACzD,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,KAAK,yBAAyB,CAC/D,CAAC;IACN,CAAC;IAED,OAAO,CAAC,KAAqB;QACzB,OAAO,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,KAAqB;QAClC,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,yBAAyB,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC;IAClH,CAAC;IAED,mBAAmB,CAAC,KAAqB;QACrC,OAAO,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,cAAc,CAAC,GAAG;YACzD,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,cAAe,CAAC,KAAK;YAC/C,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,mBAAoB,CAAC,KAAK,CAAC;IAC7D,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,OAAO;YACH,KAAK;YACL,KAAK,EAAE,cAAc,CAAC,aAAa;SACtC,CAAC;IACN,CAAC;CACJ;AA5BD,iCA4BC","sourcesContent":["import Base from './Base';\nimport type { AlexaV3DirectiveName, AlexaV3DirectiveValue, AlexaV3Request } from '../../types';\n\nexport default class TargetSetpoint extends Base {\n static matches(event: AlexaV3Request): boolean {\n return (\n event?.directive?.header?.name === 'SetTargetTemperature' ||\n event?.directive?.header?.name === 'AdjustTargetTemperature'\n );\n }\n\n matches(event: AlexaV3Request): boolean {\n return TargetSetpoint.matches(event);\n }\n\n static directive(event: AlexaV3Request): AlexaV3DirectiveName {\n return event.directive.header.name === 'AdjustTargetTemperature' ? TargetSetpoint.ADJUST : TargetSetpoint.SET;\n }\n\n alexaDirectiveValue(event: AlexaV3Request): AlexaV3DirectiveValue {\n return TargetSetpoint.directive(event) === TargetSetpoint.SET\n ? event.directive.payload.targetSetpoint!.value\n : event.directive.payload.targetSetpointDelta!.value;\n }\n\n reportValue(value: number): any {\n return {\n value,\n scale: TargetSetpoint.CELSIUS_SCALE,\n };\n }\n}\n"]}
|