homebridge-touchwand-google
Version:
57 lines • 2.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TemperatureSensor = void 0;
const hap_types_1 = require("../hap-types");
class TemperatureSensor {
constructor(hap) {
this.hap = hap;
}
sync(service) {
return {
id: service.uniqueId,
type: 'action.devices.types.SENSOR',
traits: [
'action.devices.traits.TemperatureControl',
],
name: {
defaultNames: [
service.serviceName,
service.accessoryInformation.Name,
],
name: service.serviceName,
nicknames: [],
},
willReportState: true,
attributes: {
queryOnlyTemperatureControl: true,
temperatureUnitForUX: this.hap.config.forceFahrenheit ? 'F' : 'C',
},
deviceInfo: {
manufacturer: service.accessoryInformation.Manufacturer,
model: service.accessoryInformation.Model,
hwVersion: service.accessoryInformation.HardwareRevision,
swVersion: service.accessoryInformation.SoftwareRevision,
},
customData: {
aid: service.aid,
iid: service.iid,
instanceUsername: service.instance.username,
instanceIpAddress: service.instance.ipAddress,
instancePort: service.instance.port,
},
};
}
query(service) {
var _a, _b;
return {
online: true,
temperatureSetpointCelsius: (_a = service.characteristics.find(x => x.type === hap_types_1.Characteristic.CurrentTemperature)) === null || _a === void 0 ? void 0 : _a.value,
temperatureAmbientCelsius: (_b = service.characteristics.find(x => x.type === hap_types_1.Characteristic.CurrentTemperature)) === null || _b === void 0 ? void 0 : _b.value,
};
}
execute(service, command) {
return { payload: { characteristics: [] } };
}
}
exports.TemperatureSensor = TemperatureSensor;
//# sourceMappingURL=temperature-sensor.js.map