Repository navigation
Conversation
The previous change moved the "False unless connected" gate out of is_safe() and into the Alpaca issafe/devicestate routes, keyed per client. That still blocked the use case in issue #117: a roof controller that polls /api/v1/safetymonitor/0/issafe directly and never sends Connected=true kept reading False while the dashboard showed Safe. The ASCOM spec never requires False when not connected and ConformU dropped that check on 2025-03-16, so the gate is removed and issafe, devicestate, the external API, the dashboard and MQTT now all report the debounced detector state. tests/conftest.py stubs keras.models when TensorFlow is not installed so the route-level unit tests run without the model stack.
The safety monitor could keep reporting safe while the camera image stopped updating or detection kept failing, leaving the observatory open on stale data. Refs #120 - Image hash staleness limit: max_image_age_sec (default 600, 0 disables); startup requires one new frame before reporting safe - Detection-failure limit: max(180, 3x update interval) - Both commit unsafe immediately; recovery waits debounce_to_safe_sec - Home Assistant data availability topic plus Safe binary_sensor - Legacy MQTT is_safe field - Setup page field with live preview - Dashboard image row - External API image object - Tests for stale fail-safe and image status API, shared conftest
Enhance Safety Monitor with Stale Data Failsafe and Reporting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Overview
This pull request significantly enhances the safety monitor by introducing a failsafe mechanism that triggers an unsafe state if camera images become stale or detection continuously fails. It also corrects the
IsSafereporting logic, ensuring all clients consistently receive the true debounced detector state, regardless of their connection status, aligning with updated ASCOM specifications.🔄 Changes by Category
max_image_age_sec).IsSafereporting logic to always reflect the true debounced detector state to all Alpaca clients and external APIs, removing the "False unless connected" gate.IsSafelogic by moving the "False unless connected" gate out of the coreis_safe()function.readme.mdto reflect new safety monitor features and configuration.docs/EXTERNAL_API.mdto reflect changes in the external API.IsSafegating, MQTT reconnect, and multi-client verification.keras.modelsstubbing toconftest.pyto allow route-level unit tests to run without TensorFlow.max_image_age_sectoalpaca/config.pyfor configuring image staleness.📊 Analyzed 6 commit(s) | 🕐 Updated: 2026-10-12T08:01:40.975Z | Generated by GitHub Actions