mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-10-11 15:02:06 -06:00
18 lines
605 B
TypeScript
18 lines
605 B
TypeScript
|
import { InclusionReportService } from "../fimp/inclusion_report";
|
||
|
import { VinculumPd7Device } from "../fimp/vinculum_pd7_device";
|
||
|
import { CMP } from "../ha/publish_device";
|
||
|
|
||
|
export function cmps_sensor_co(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: CMP } {
|
||
|
if (!svc.address) { return {}; }
|
||
|
|
||
|
return {
|
||
|
[svc.address]: {
|
||
|
p: "sensor",
|
||
|
device_class: "carbon_monoxide",
|
||
|
unit_of_measurement: svc.props?.sup_units?.[0] ?? "mol/m3",
|
||
|
value_template: `{{ value_json['${svc.address}'].sensor }}`,
|
||
|
unique_id: svc.address,
|
||
|
},
|
||
|
};
|
||
|
}
|