mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 07:37:09 +00:00
26 lines
652 B
TypeScript
26 lines
652 B
TypeScript
import {
|
|
VinculumPd7Device,
|
|
VinculumPd7Service,
|
|
} from '../fimp/vinculum_pd7_device';
|
|
import { ServiceComponentsCreationResult } from '../ha/publish_device';
|
|
|
|
export function sensor_presence__components(
|
|
topicPrefix: string,
|
|
device: VinculumPd7Device,
|
|
svc: VinculumPd7Service,
|
|
_svcName: string,
|
|
): ServiceComponentsCreationResult | undefined {
|
|
const device_class = 'occupancy';
|
|
|
|
return {
|
|
components: {
|
|
[svc.addr]: {
|
|
unique_id: svc.addr,
|
|
platform: 'binary_sensor',
|
|
device_class: device_class,
|
|
value_template: `{{ value_json['${svc.addr}'].presence | iif('ON', 'OFF') }}`,
|
|
},
|
|
},
|
|
};
|
|
}
|