Add Server-Sent Events (SSE) API documentation and README updates
- Created comprehensive SSE API documentation in `docs/SSE_API.md` - Updated README.md with new features section highlighting SSE capabilities - Added `.cursornotes` file for SSE subscription flow - Provided detailed examples and usage guidelines for SSE integration - Documented event types, authentication, and best practices for real-time updates
This commit is contained in:
33
README.md
33
README.md
@@ -11,6 +11,39 @@ A powerful bridge between your Home Assistant instance and Language Learning Mod
|
||||

|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- 🎮 **Device Control**: Control any Home Assistant device through natural language
|
||||
- 🔄 **Real-time Updates**: Get instant updates through Server-Sent Events (SSE)
|
||||
- 🤖 **Automation Management**: Create, update, and manage automations
|
||||
- 📊 **State Monitoring**: Track and query device states
|
||||
- 🔐 **Secure**: Token-based authentication and rate limiting
|
||||
- 📱 **Mobile Ready**: Works with any HTTP-capable client
|
||||
|
||||
## Real-time Updates with SSE
|
||||
|
||||
The server includes a powerful Server-Sent Events (SSE) system that provides real-time updates from your Home Assistant instance. This allows you to:
|
||||
|
||||
- 🔄 Get instant state changes for any device
|
||||
- 📡 Monitor automation triggers and executions
|
||||
- 🎯 Subscribe to specific domains or entities
|
||||
- 📊 Track service calls and script executions
|
||||
|
||||
### Quick SSE Example
|
||||
|
||||
```javascript
|
||||
const eventSource = new EventSource(
|
||||
'http://localhost:3000/subscribe_events?token=YOUR_TOKEN&domain=light'
|
||||
);
|
||||
|
||||
eventSource.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
console.log('Update received:', data);
|
||||
};
|
||||
```
|
||||
|
||||
See [SSE_API.md](docs/SSE_API.md) for complete documentation of the SSE system.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Key Features](#key-features)
|
||||
|
||||
Reference in New Issue
Block a user