11111
This commit is contained in:
+43
-1
@@ -47,6 +47,42 @@ export type Dashboard = {
|
||||
currentPlan?: HealthPlan
|
||||
}
|
||||
|
||||
export type HomeAssistantDevice = {
|
||||
code: string
|
||||
name: string
|
||||
entityId: string
|
||||
state: string
|
||||
value?: string
|
||||
unit?: string
|
||||
isAvailable: boolean
|
||||
lastUpdated?: string
|
||||
}
|
||||
|
||||
export type HomeAssistantStatus = {
|
||||
connected: boolean
|
||||
message: string
|
||||
checkedAt: string
|
||||
devices: HomeAssistantDevice[]
|
||||
environment: HomeAssistantDevice[]
|
||||
}
|
||||
|
||||
export type HomeAssistantSceneAction = {
|
||||
name: string
|
||||
entityId: string
|
||||
status: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type HomeAssistantSceneResult = {
|
||||
sceneCode: string
|
||||
sceneName: string
|
||||
success: boolean
|
||||
status: string
|
||||
message: string
|
||||
executedAt: string
|
||||
actions: HomeAssistantSceneAction[]
|
||||
}
|
||||
|
||||
export const healthApi = {
|
||||
register: (payload: { phone: string; password: string; displayName: string }) =>
|
||||
http.post<never, AuthOutput>('/api/health/auth/register', payload),
|
||||
@@ -57,5 +93,11 @@ export const healthApi = {
|
||||
http.put<never, HealthProfile>('/api/health/profile', payload),
|
||||
saveModules: (moduleCodes: string[]) =>
|
||||
http.put<never, string[]>('/api/health/modules', { moduleCodes }),
|
||||
generatePlan: () => http.post<never, HealthPlan>('/api/health/plans/generate')
|
||||
generatePlan: () => http.post<never, HealthPlan>('/api/health/plans/generate'),
|
||||
homeAssistantStatus: () =>
|
||||
http.get<never, HomeAssistantStatus>('/api/health/home-assistant/status'),
|
||||
executeSleepScene: () =>
|
||||
http.post<never, HomeAssistantSceneResult>('/api/health/home-assistant/scenes/sleep'),
|
||||
executeAllOffScene: () =>
|
||||
http.post<never, HomeAssistantSceneResult>('/api/health/home-assistant/scenes/all-off')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user