initial release of Alex2Node
This commit is contained in:
parent
0804bd7397
commit
4eb2a84d72
20 changed files with 2047 additions and 3 deletions
32
dist/ActionMapping.js
vendored
Normal file
32
dist/ActionMapping.js
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionMapping = exports.AlexaActions = void 0;
|
||||
var AlexaActions;
|
||||
(function (AlexaActions) {
|
||||
AlexaActions["Open"] = "Alexa.Actions.Open";
|
||||
AlexaActions["Close"] = "Alexa.Actions.Close";
|
||||
AlexaActions["Raise"] = "Alexa.Actions.Raise";
|
||||
AlexaActions["Lower"] = "Alexa.Actions.Lower";
|
||||
AlexaActions["SetEcoOn"] = "Alexa.Actions.SetEcoOn";
|
||||
AlexaActions["SetEcoOff"] = "Alexa.Actions.SetEcoOff";
|
||||
})(AlexaActions || (exports.AlexaActions = AlexaActions = {}));
|
||||
class ActionMapping {
|
||||
constructor(actions, directiveName, directivePayload) {
|
||||
this.type = "ActionsToDirective";
|
||||
this.actions = actions;
|
||||
this.directive = {
|
||||
name: directiveName,
|
||||
};
|
||||
if (directivePayload) {
|
||||
this.directive.payload = directivePayload;
|
||||
}
|
||||
}
|
||||
toJSON() {
|
||||
return {
|
||||
"@type": this.type,
|
||||
actions: this.actions,
|
||||
directive: this.directive,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.ActionMapping = ActionMapping;
|
||||
Loading…
Add table
Add a link
Reference in a new issue