Skip to content
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

Fix manual.alarm_control_panel RestoreEntity bugs #82990

Merged
merged 2 commits into from Dec 19, 2022

Conversation

bonzini
Copy link
Contributor

@bonzini bonzini commented Nov 30, 2022

Proposed change

The RestoreEntity implementation for the manual alarm control panel does not correctly restore timers. After this pull request, it restores the full state of the integration instead.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@MartinHjelmare MartinHjelmare changed the title manual.alarm_control_panel: Fix RestoreEntity bugs Fix manual.alarm_control_panel RestoreEntity bugs Dec 1, 2022
@kbickar
Copy link
Contributor

kbickar commented Dec 1, 2022

Why did you rename all the functions to async_? There aren't actually any async calls in any of them

@bonzini
Copy link
Contributor Author

bonzini commented Dec 1, 2022

Why did you rename all the functions to async_

Because they must be called from the event loop and therefore can/must call the async_ version of the functions. I followed what seemed to be the convention with async_track_point_in_time and async_render: they are not async themselves but are called async_.

@jbouwh
Copy link
Contributor

jbouwh commented Dec 6, 2022

It helps if you split the refactor to a separate PR.

@bonzini
Copy link
Contributor Author

bonzini commented Dec 6, 2022

Will do.

@bonzini bonzini force-pushed the manual-restore-fix branch 2 times, most recently from 1557fde to 07d4e17 Compare December 6, 2022 22:22
@bonzini bonzini changed the title Fix manual.alarm_control_panel RestoreEntity bugs Draft: Fix manual.alarm_control_panel RestoreEntity bugs Dec 6, 2022
@frenck frenck changed the title Draft: Fix manual.alarm_control_panel RestoreEntity bugs Fix manual.alarm_control_panel RestoreEntity bugs Dec 6, 2022
@frenck frenck marked this pull request as draft December 6, 2022 22:27
@frenck
Copy link
Member

frenck commented Dec 6, 2022

Instead of renaming the title of the PR to prefix "Draft: ", please just put the PR in actual draft.

@bonzini
Copy link
Contributor Author

bonzini commented Dec 6, 2022

Sorry, got confused by GitHub/Gitlab differences. This is now draft until the dependency #83436 is ready and committed.

@bonzini bonzini marked this pull request as ready for review December 17, 2022 23:49
@jbouwh
Copy link
Contributor

jbouwh commented Dec 19, 2022

Tested with manual alarm control panel. If it is armed and HA is restarted it return in never ending pending state.
UPDATE: After some repeated tests I could not reproduce it, so may be it is nothing afterall.

Copy link
Contributor

@jbouwh jbouwh left a comment

Choose a reason for hiding this comment

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

Looks good to me,
Thnx @bonzini!

@jbouwh jbouwh merged commit 5259471 into home-assistant:dev Dec 19, 2022
@jbouwh jbouwh added this to the 2022.12.7 milestone Dec 19, 2022
@frenck frenck modified the milestones: 2022.12.7, 2022.12.8 Dec 19, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2022
@balloob balloob removed this from the 2022.12.8 milestone Dec 21, 2022
@balloob
Copy link
Member

balloob commented Dec 21, 2022

Removed this from the milestone because it builds on top of the async conversion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants