homebridge-tessie
Version:
Connect Homebridge to your Tessie account.
18 lines • 811 B
JavaScript
import { BaseService } from "./base.js";
export class DefrostService extends BaseService {
constructor(parent) {
super(parent, parent.platform.Service.Switch, "Defrost", "defrost");
const on = this.service
.getCharacteristic(this.parent.platform.Characteristic.On)
.onSet(async (value) => {
await this.parent.wakeUpAndWait()
.then(() => this.vehicle.set_preconditioning_max(value, false))
.then(() => on.updateValue(value))
.catch((e) => this.log.error(`${this.name} vehicle set_preconditioning_max failed: ${e}`));
});
this.parent.emitter.on("vehicle_data", (data) => {
on.updateValue(data.climate_state.defrost_mode > 0);
});
}
}
//# sourceMappingURL=defrost.js.map