-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make repairs out of select supervisor issues #90893
Conversation
Hey there @home-assistant/supervisor, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
06e0014
to
477686f
Compare
a0aba6e
to
fd0d18d
Compare
fd0d18d
to
08d552b
Compare
08d552b
to
2caabdb
Compare
return f"{self.context}_{self.type_}" | ||
|
||
@staticmethod | ||
def from_dict(data: SuggestionDataType) -> Suggestion: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method can preferably be a classmethod
as it returns an instance of the class.
return f"issue_{self.context}_{self.type_}" | ||
|
||
@staticmethod | ||
def from_dict(data: IssueDataType) -> Issue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
severity=IssueSeverity.WARNING, | ||
translation_key=issue.key, | ||
translation_placeholders={PLACEHOLDER_KEY_REFERENCE: issue.reference} | ||
if issue.reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ternary operator expressions that span more than one line are hard to read.
|
||
async def async_step_init(self, _: None = None) -> FlowResult: | ||
"""Handle the first step of a fix flow.""" | ||
# Got out of sync with supervisor, issue is resolved or isn't fixable. Either way, resolve the repair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please break long strings and comments around 88 characters per line.
data = await self._client.get_resolution_info() | ||
self.unhealthy_reasons = set(data[ATTR_UNHEALTHY]) | ||
self.unsupported_reasons = set(data[ATTR_UNSUPPORTED]) | ||
|
||
# Remove any cached issues that weren't returned | ||
for issue_id in set(self._issues.keys()) - { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying a dict to a set uses the keys by default. We can remove .keys()
.
Proposed change
As of home-assistant/supervisor#4218 Supervisor is now creating an issue when it detects multiple filesystems with the name
hassos-data
. Because that creates a race condition at system startup, since OS uses the first filesystem it sees with the namehassos-data
as the data disk.In addition home-assistant/supervisor#3984 added a new "reboot required" supervisor issue created when a user adjusts settings on their board as those require a system reboot to take effect.
Currently these supervisor issues are buried in the CLI. This PR adds support for easily turning supervisor issues into repairs and applying supervisor's suggestions to fix them. It contains a hard-coded list of which issues should be presented as repairs so we can evaluate each on a case-by-case basis. For now only the two described above will be presented as repairs.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: