homebridge-tessie
Version:
Connect Homebridge to your Tessie account.
29 lines • 1.1 kB
JavaScript
export class BaseService {
parent;
service;
log;
platform;
accessory;
emitter;
energy;
name;
constructor(parent, definition, name, subtype) {
this.parent = parent;
this.log = parent.platform.log;
this.platform = parent.platform;
this.accessory = parent.accessory;
this.emitter = parent.emitter;
this.energy = parent.energy;
this.name = parent.platform.config.prefixName ? `${this.parent.accessory.displayName} ${name}` : name;
this.service =
this.accessory.getServiceById(definition, subtype) ||
this.accessory.addService(definition, this.name, subtype);
// Set the configured name if it's not already set since Homekit wont use the display name
const ConfiguredName = this.service.getCharacteristic(this.platform.Characteristic.ConfiguredName);
if (!ConfiguredName.value) {
this.log.debug(`Configured name changing to ${this.name}`);
ConfiguredName.updateValue(this.name);
}
}
}
//# sourceMappingURL=base.js.map