Repository navigation
feat(control): new installs let only administrators operate the panel - #329
Merged
Merged
Conversation
An install that has made no choice should not hand every non-admin user the panel's relays, so the control mode for an entry that never set one is now administrators only. New entries store it, so a release from before this default reads the entry the same way after a downgrade. Entries created before this default allowed any user. Migration 7.4 writes that into each one whose stored mode is absent or unreadable, the way 7.2 did for control without a logged-in user, so upgrading takes no control away from anyone. A mode already chosen is kept, and an unrecognised value still reads as any user. The README's options table gives the new default.
Merged
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.
New installs default Who may operate the panel to Administrators only. Existing installs keep what they had.
Change
control_gate.py:DEFAULT_CONTROL_MODE = ControlMode.ADMIN_ONLYis the mode for an entry that never stored one, inControlPolicy.default()andfrom_options. An unrecognised stored value still reads as any user, so a typo in.storagecannot lock a household out.config_flow.py: a new entry storescontrol_mode: admin_only, besideallow_contextless_control, so a release from before this default reads it the same way after a downgrade.MINOR_VERSIONmoves to 4.migrations.py: step 7.3 → 7.4 writesall_usersinto every entry whose stored mode is absent or not a known mode, which is how each one reads today. A known mode is the user's choice and is kept. This is the pattern 7.2 used for control without a logged-in user.config_flow_options.py: the options form shows the new default for an entry with none stored.Checks
"nonsense",None,1, a list); Home Assistant actually runs 7.4; the default policy is administrators only. Two 7.3 tests now expect the current minor version.