Update service types

This commit is contained in:
Adrian Jagielak
2025-07-23 13:50:33 +02:00
parent bdaa733794
commit 9dd9046954
43 changed files with 167 additions and 151 deletions

View File

@@ -78,13 +78,29 @@ type HaDeviceConfig = {
qos: number,
}
export type HaComponent = {
export type HaComponent = SensorComponent | BinarySensorComponent | SwitchComponent;
type SensorComponent = {
unique_id: string;
// platform
p: string;
p: 'sensor';
device_class?: string;
unit_of_measurement?: string;
value_template?: string;
value_template: string;
}
type BinarySensorComponent = {
unique_id: string;
// platform
p: 'binary_sensor';
device_class?: string;
value_template: string;
}
type SwitchComponent = {
unique_id: string;
// platform
p: 'switch';
}
const serviceHandlers: {