11
This commit is contained in:
+24
-1
@@ -75,6 +75,7 @@ export type HomeAssistantDiscoveredDevice = {
|
||||
areaName?: string
|
||||
category: HealthDeviceCategory | string
|
||||
online: boolean
|
||||
primaryControlEntityId?: string | null
|
||||
entities: HomeAssistantEntity[]
|
||||
metrics?: Record<string, unknown>
|
||||
}
|
||||
@@ -102,6 +103,25 @@ export type HomeAssistantEnvironmentData = {
|
||||
tvoc?: number | null
|
||||
}
|
||||
|
||||
export type HomeAssistantScenePreset = {
|
||||
deviceName: string
|
||||
category: string
|
||||
entityId: string
|
||||
available: boolean
|
||||
availabilityMessage: string
|
||||
action: string
|
||||
detail: string
|
||||
parameters: Record<string, unknown>
|
||||
}
|
||||
|
||||
export type HomeAssistantDeviceSwitchOutput = {
|
||||
success: boolean
|
||||
deviceId: string
|
||||
entityId: string
|
||||
state: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type HomeAssistantStatus = {
|
||||
connected: boolean
|
||||
message: string
|
||||
@@ -110,6 +130,7 @@ export type HomeAssistantStatus = {
|
||||
devices: HomeAssistantDiscoveredDevice[]
|
||||
sceneDevices: HomeAssistantSceneDevicesSummary
|
||||
environment: HomeAssistantEnvironmentData
|
||||
scenePresets?: HomeAssistantScenePreset[]
|
||||
}
|
||||
|
||||
export type HomeAssistantSceneAction = {
|
||||
@@ -145,5 +166,7 @@ export const healthApi = {
|
||||
executeSleepScene: () =>
|
||||
http.post<never, HomeAssistantSceneResult>('/api/health/home-assistant/scenes/sleep'),
|
||||
executeAllOffScene: () =>
|
||||
http.post<never, HomeAssistantSceneResult>('/api/health/home-assistant/scenes/all-off')
|
||||
http.post<never, HomeAssistantSceneResult>('/api/health/home-assistant/scenes/all-off'),
|
||||
switchDevice: (payload: { deviceId: string; turnOn: boolean; entityId?: string }) =>
|
||||
http.post<never, HomeAssistantDeviceSwitchOutput>('/api/health/home-assistant/devices/switch', payload)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user