Skip to content

Conversation

@CyberDNS
Copy link
Owner

Changed from checking StatusEx/DOORBELL to checking the AlarmStatus field, which is the correct field for smoke alarm detection based on the Lupusec API specification used by other integrations (ioBroker.lupusec).

This matches the pattern already used in MoistureDetector where AlarmStatus is checked for alarm conditions.

Changed from checking StatusEx/DOORBELL to checking the AlarmStatus field,
which is the correct field for smoke alarm detection based on the Lupusec
API specification used by other integrations (ioBroker.lupusec).

This matches the pattern already used in MoistureDetector where AlarmStatus
is checked for alarm conditions.
@CyberDNS CyberDNS requested a review from Copilot November 14, 2025 16:36
@CyberDNS CyberDNS merged commit 8726f55 into master Nov 14, 2025
7 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR corrects the smoke detector state detection logic by switching from checking StatusEx/DOORBELL fields to using the AlarmStatus field, aligning with the Lupusec API specification referenced by other integrations like ioBroker.lupusec.

  • Updates SmokeDetector.GetState() to use the AlarmStatus field instead of StatusEx and Status
  • Adds inline documentation explaining the new approach
  • Brings the implementation closer to the pattern used in MoistureDetector

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +31
// Check AlarmStatus field - any non-empty value indicates smoke/fire alarm is triggered
var result = !string.IsNullOrEmpty(sensor.AlarmStatus) ? "ON" : "OFF";
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation is inconsistent with other alarm detectors in the codebase. MoistureDetector checks for a specific value AlarmStatus.Equals("WATER", StringComparison.OrdinalIgnoreCase), and AlarmDetectionSensor checks for "BURGLAR".

Using !string.IsNullOrEmpty() could potentially trigger false positives if AlarmStatus contains unexpected values. Consider checking for a specific alarm status value instead, such as "SMOKE" or "FIRE", to match the pattern used by other detectors and ensure more precise alarm detection.

Suggested change
// Check AlarmStatus field - any non-empty value indicates smoke/fire alarm is triggered
var result = !string.IsNullOrEmpty(sensor.AlarmStatus) ? "ON" : "OFF";
// Check AlarmStatus field - "SMOKE" or "FIRE" indicates smoke/fire alarm is triggered
var result = (sensor.AlarmStatus != null &&
(sensor.AlarmStatus.Equals("SMOKE", StringComparison.OrdinalIgnoreCase) ||
sensor.AlarmStatus.Equals("FIRE", StringComparison.OrdinalIgnoreCase)))
? "ON" : "OFF";

Copilot uses AI. Check for mistakes.
@CyberDNS CyberDNS deleted the claude/document-app-functionality-01YRwJrc6VoiyNaN5ZWbnouj branch November 14, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants