diff --git a/ACTION_MAPPING_SUMMARY.md b/ACTION_MAPPING_SUMMARY.md deleted file mode 100644 index db8d28f..0000000 --- a/ACTION_MAPPING_SUMMARY.md +++ /dev/null @@ -1,59 +0,0 @@ -## AlpineBits Action Mapping System - -### Problem Solved -The AlpineBits specification uses different names for the same action: -- **Capability JSON**: `"action_OTA_Read"` (advertised in handshake) -- **Request Action**: `"OTA_Read:GuestRequests"` (actual request parameter) - -### Solution Architecture - -#### 1. Enhanced AlpineBitsActionName Enum -```python -# Maps capability names to request names -OTA_READ = ("action_OTA_Read", ["OTA_Read:GuestRequests", "OTA_Read"]) -``` - -#### 2. Automatic Action Discovery -- `ServerCapabilities` scans for implemented actions -- Only includes actions with overridden `handle()` methods -- Generates capability JSON using capability names - -#### 3. Request Routing -- `AlpineBitsServer.handle_request()` accepts request action names -- Maps request names back to capability names -- Routes to appropriate action handler -- Validates version support - -### Key Features - -✅ **Automatic Discovery**: New action implementations are automatically detected -✅ **Name Mapping**: Handles capability vs request name differences -✅ **Version Support**: Actions can support multiple versions -✅ **Error Handling**: Proper HTTP status codes (200, 400, 401, 500) -✅ **Capability Generation**: Dynamic JSON generation for handshakes - -### Usage Example - -```python -# Server automatically discovers implemented actions -server = AlpineBitsServer() - -# Handle request with different name format -response = await server.handle_request( - "OTA_Read:GuestRequests", # Request name - xml_content, - "2024-10" -) - -# Capability JSON uses "action_OTA_Read" automatically -capabilities = server.get_capabilities_json() -``` - -### Adding New Actions - -1. Create action class inheriting from `AlpineBitsAction` -2. Add mapping to `AlpineBitsActionName` enum -3. Implement `handle()` method -4. Deploy - action automatically appears in capabilities - -The system is now production-ready for handling AlpineBits protocol quirks! \ No newline at end of file diff --git a/README.md b/README.md index 4feb4d4..2f02129 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,14 @@ Die Umgebungsvariable `ALPINEBITS_CONFIG_DIR` sagt dann dem Programm wo es die C +# TODO Liste + +Need a table in the database that stores requests that have already been acknowledged by the client. Should contain client_id + a list of all acked unique_ids + + + + +