Add global brightness control feature with socket handling and UI updates

This commit is contained in:
2025-07-07 10:05:14 +03:00
parent 09d8871ac3
commit d0f34846f8
3 changed files with 201 additions and 95 deletions

8
app.py
View File

@@ -113,6 +113,14 @@ def handle_animation_speed_update(data):
# Broadcast animation speed update to all clients
emit('animation_speed_update', data, broadcast=True, include_self=False)
@socketio.on('brightness_update')
def handle_brightness_update(data):
"""Handle brightness updates from controller"""
print(f'Brightness update received: {data}')
print(f'Broadcasting brightness update to {len(connected_clients)} clients')
# Broadcast brightness update to all clients
emit('brightness_update', data, broadcast=True, include_self=False)
@socketio.on('join_room')
def handle_join_room(data):
"""Handle client joining a specific room"""