Refactor SSE and Home Assistant Integration with Enhanced Configuration

- Simplified SSE statistics retrieval in routes
- Extended Home Assistant configuration with additional connection parameters
- Implemented comprehensive Home Assistant instance methods for services, states, and events
- Cleaned up and type-refined Home Assistant interfaces
- Improved WebSocket event handling and type conversion
This commit is contained in:
jango-blockchained
2025-02-03 15:11:46 +01:00
parent f049f439b9
commit 149d3a585e
5 changed files with 94 additions and 22 deletions

View File

@@ -15,7 +15,9 @@ config({ path: resolve(process.cwd(), envFile) });
export const HASS_CONFIG = {
HOST: process.env.HASS_HOST || 'http://homeassistant.local:8123',
TOKEN: process.env.HASS_TOKEN,
SOCKET_URL: process.env.HASS_SOCKET_URL || 'ws://homeassistant.local:8123/api/websocket'
SOCKET_URL: process.env.HASS_SOCKET_URL || 'ws://homeassistant.local:8123/api/websocket',
BASE_URL: process.env.HASS_HOST || 'http://homeassistant.local:8123',
SOCKET_TOKEN: process.env.HASS_TOKEN
};
// Server Configuration