homebridge-tessie
Version:
Connect Homebridge to your Tessie account.
25 lines • 1.21 kB
JavaScript
import { BaseService } from "./base.js";
export class HomelinkService extends BaseService {
constructor(parent) {
super(parent, parent.platform.Service.GarageDoorOpener, "Homelink", "homelink");
const current = this.service
.getCharacteristic(this.platform.Characteristic.CurrentDoorState)
.updateValue(this.platform.hap.Characteristic.CurrentDoorState.CLOSED);
const target = this.service
.getCharacteristic(this.platform.Characteristic.TargetDoorState)
.onSet(async (value) => {
if (value) {
target.updateValue(value);
await this.parent.wakeUpAndWait()
.then(() => this.vehicle.trigger_homelink(this.platform.config.latitude, this.platform.config.longitude))
.then(() => {
current.updateValue(false);
target.updateValue(false);
})
.catch((e) => this.log.error(`${this.name} vehicle trigger_homelink failed: ${e}`));
}
})
.updateValue(this.platform.hap.Characteristic.TargetDoorState.CLOSED);
}
}
//# sourceMappingURL=homelink.js.map