Commit Graph

13 Commits

Author SHA1 Message Date
Josh Finlay 597d0b9204 fix: mqtt connection handling
- Added proper MQTT callback handlers
- Made on_connect trigger _post_connect asynchronously
- Improved connection error handling
- Added sleep after successful connection
- Added sleep between retries
2025-01-08 10:18:42 +10:00
Josh Finlay a065964bd1 fix: mqtt async calls
- Removed await from publish() and subscribe() calls
- Updated publish_state to handle state conversion and qos
- Kept await for connect() and disconnect()
2025-01-08 10:13:53 +10:00
Josh Finlay 925f612ede fix: mqtt subscription format
- Updated subscribe calls to match gmqtt example
- Added qos=1 parameter to subscriptions
2025-01-08 10:09:48 +10:00
Josh Finlay 7a22813d8e fix: mqtt subscription format
- Use gmqtt's Subscription class for MQTT subscriptions
- Updated both _post_connect and subscribe methods
2025-01-08 10:05:53 +10:00
Josh Finlay 92daf9c8ad fix: mqtt subscription format
- Updated subscription format to use dict with topic and qos fields
- Fixed both _post_connect and subscribe methods
2025-01-08 10:04:00 +10:00
Josh Finlay 771a0d3e23 fix: mqtt qos constant
- Use integer 1 for QoS level instead of importing constant
2025-01-08 10:02:26 +10:00
Josh Finlay aa1b6b384d fix: mqtt integration
- 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
2025-01-08 10:00:38 +10:00
Josh Finlay 2474253efa fix: mqtt subscription format
- Updated MQTT subscription to use dict format with topic and qos
- Added better logging for MQTT connection status
2025-01-08 09:50:09 +10:00
Josh Finlay c8a48e8e7a fix: event pagination
- 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
2025-01-08 09:47:01 +10:00
Josh Finlay 9dc65a138f feat: add event cleanup
- 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
2025-01-08 09:38:34 +10:00
Josh Finlay da3b3ec748 feat: Add comprehensive logging
- Add rotating file logging to /var/log/gatekeeper.log
- Log application events, MQTT, settings, and errors
- Include stack traces and improved error handling
2025-01-08 07:51:54 +10:00
Josh Finlay f6ca88f012 feat: Add MQTT and settings event logging, implement event pagination
- 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
2025-01-08 07:46:08 +10:00
Josh Finlay 70f7e4fd84 Add MQTT integration with Home Assistant and update deployment script 2025-01-08 07:39:07 +10:00