- Removed await from publish() and subscribe() calls
- Updated publish_state to handle state conversion and qos
- Kept await for connect() and disconnect()
- Fixed subscription format to use QOS_1 constant
- Added more detailed logging
- Set initial state to 'closed' explicitly
- Made publish_state handle both bool and str states
- Added retain flag to state messages
- Added secondary sort by id DESC for consistent ordering
- Fixed hasMore calculation to use actual events returned
- Only append events in frontend if we got new ones
- Made SQL query more readable
- Added background task to clean up events older than 3 months
- Added index on timestamp column for faster cleanup
- Fixed success column type in events table
- Updated shutdown handler for new task
- Add event logging for MQTT connection states
- Add event logging for settings changes
- Make event list more compact
- Implement pagination for event list with 'Show More' button