homebridge-loxone-proxy
Version:
Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.
24 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Switch = void 0;
const LoxoneAccessory_1 = require("../../LoxoneAccessory");
const LockMechanism_1 = require("../../homekit/services/LockMechanism");
const Outlet_1 = require("../../homekit/services/Outlet");
const Switch_1 = require("../../homekit/services/Switch");
class Switch extends LoxoneAccessory_1.LoxoneAccessory {
configureServices() {
var _a, _b, _c;
this.ItemStates = {
[this.device.states.active]: { 'service': 'PrimaryService', 'state': 'active' },
};
const isLock = this.device.name.includes((_a = this.platform.config.switchAlias) === null || _a === void 0 ? void 0 : _a.Lock);
const isOutlet = ((_b = this.device.catIcon) === null || _b === void 0 ? void 0 : _b.includes('outlet')) || ((_c = this.device.defaultIcon) === null || _c === void 0 ? void 0 : _c.includes('outlet'));
this.Service.PrimaryService = isOutlet
? new Outlet_1.Outlet(this.platform, this.Accessory)
: isLock
? new LockMechanism_1.LockMechanism(this.platform, this.Accessory)
: new Switch_1.Switch(this.platform, this.Accessory);
}
}
exports.Switch = Switch;
//# sourceMappingURL=Switch.js.map