diff --git a/src/services/health.ts b/src/services/health.ts index 6d9c99b..ccf32cd 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -175,6 +175,23 @@ export type HomeAssistantDeviceSwitchOutput = { message: string } +export type HomeAssistantLightTransition = { + success: boolean + running: boolean + mode: 'none' | 'sleep' | 'wake' + brightnessPercent: number + targetPercent: number + message: string +} + +export type HomeAssistantSpeakerDemo = { + audioUrl: string + speakerOnline: boolean + directPlaybackSupported: boolean + commandAccepted: boolean + message: string +} + export type HomeAssistantStatus = { connected: boolean message: string @@ -236,6 +253,18 @@ export const healthApi = { http.post('/api/health/assessment', payload), homeAssistantStatus: () => http.get('/api/health/home-assistant/status'), + lightTransitionStatus: () => + http.get('/api/health/home-assistant/lights/transition'), + startSleepLight: () => + http.post('/api/health/home-assistant/lights/sleep'), + startWakeLight: () => + http.post('/api/health/home-assistant/lights/wake'), + stopLightTransition: () => + http.post('/api/health/home-assistant/lights/stop'), + speakerDemoStatus: () => + http.get('/api/health/home-assistant/speaker/demo'), + playSpeakerDemo: () => + http.post('/api/health/home-assistant/speaker/play-demo'), executeSleepScene: () => http.post('/api/health/home-assistant/scenes/sleep'), executeAllOffScene: () => diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index 6843374..92ddb1d 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -120,7 +120,7 @@ onMounted(load)
助眠灯光 - {{ dashboard?.sceneConfig?.lightBrightnessPercent || 20 }}% · {{ dashboard?.sceneConfig?.lightColorTemperatureKelvin || 2700 }}K + 50%渐暗至关闭 · {{ dashboard?.sceneConfig?.lightColorTemperatureKelvin || 2700 }}K
助眠音箱 diff --git a/src/views/DeviceControlView.vue b/src/views/DeviceControlView.vue index f42efdf..83595c3 100644 --- a/src/views/DeviceControlView.vue +++ b/src/views/DeviceControlView.vue @@ -1,5 +1,5 @@