Skip to content

Add a dedicated error for devices without the button press - #1202

Merged
frenck merged 1 commit into
mainfrom
frenck/local-auth-unsupported-error
Oct 11, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/local-auth-unsupported-error

Conversation

@frenck

@frenck frenck commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Proposed Changes

(Describe the changes and rationale behind them)

Adds LaMetricUnsupportedError, raised by LaMetricLocalAuth.request_challenge() when the device does not support getting its API key with a press on its button (like an LM 37X8 TIME, which answers with a 401).

Until now that case was a plain LaMetricError, just like an unexpected or broken answer from the device. A caller could not tell "this device cannot do this" apart from "something went wrong", so Home Assistant would tell the user their device does not support the button for any failure.

The new error subclasses LaMetricError, so existing code catching LaMetricError keeps working. Every other failure stays a plain LaMetricError, and a test now guards that.

Verified on the real LM 37X8 TIME (firmware 2.3.9): request_challenge() raises LaMetricUnsupportedError, which is still a LaMetricError.

Related Issues

(Github link to related issues or pull requests)

Raised in review on home-assistant/core#184197. Follow up on #1199.

@frenck frenck added the new-feature New features or options. label Oct 9, 2026
@frenck
frenck merged commit 5f321c3 into main Oct 11, 2026
32 checks passed
@frenck
frenck deleted the frenck/local-auth-unsupported-error branch October 11, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant