mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-12-09 17:39:01 +00:00
Implement all sensors and low battery state
This commit is contained in:
21
futurehome/src/services/sensor_dew.ts
Normal file
21
futurehome/src/services/sensor_dew.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { InclusionReportService } from "../fimp/inclusion_report";
|
||||
import { VinculumPd7Device } from "../fimp/vinculum_pd7_device";
|
||||
import { CMP } from "../ha/publish_device";
|
||||
|
||||
export function cmps_sensor_dew(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: CMP } {
|
||||
if (!svc.address) { return {}; }
|
||||
|
||||
let unit = svc.props?.sup_units?.[0] ?? "℃";
|
||||
if (unit === 'C') unit = '℃';
|
||||
if (unit === 'F') unit = '℉';
|
||||
|
||||
return {
|
||||
[svc.address]: {
|
||||
p: "sensor",
|
||||
device_class: "temperature",
|
||||
unit_of_measurement: unit,
|
||||
value_template: `{{ value_json['${svc.address}'].sensor }}`,
|
||||
unique_id: svc.address,
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user