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 HomeKit with entity registry restoration where supported_features is a non-None falsey #30657

Merged
merged 2 commits into from
Jan 11, 2020

Conversation

Jc2k
Copy link
Member

@Jc2k Jc2k commented Jan 10, 2020

Description:

Whilst trying to recreate #30638 i managed to write some unit tests that trigger the same exception. I don't think they are the root cause of that ticket but I thought it was weird that supported_features could be None - the restoration PR set it to 0 in a bunch of places. So this PR will propagate "falsies" that aren't None from the entity registry to the unavailable state. This fixes supported_features getting set as None instead of 0 (which is a valid value and should be allowed to be part of the state).

This includes a bunch of tests to make sure that HomeKit does handle states restored from the entity registry, including e.g. where no value for supported_features exists in the entity registry.

Related: #30638 #30094

CC @balloob

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]

@balloob balloob added this to the 0.104.0 milestone Jan 11, 2020
@balloob balloob merged commit 669c89e into home-assistant:dev Jan 11, 2020
@balloob
Copy link
Member

balloob commented Jan 11, 2020

Good catch !

balloob pushed a commit that referenced this pull request Jan 11, 2020
… is a non-None falsey (#30657)

* Fix homekit with #30094

* Fix test
@Jc2k Jc2k deleted the entity_registry_restore_fix branch January 11, 2020 09:56
@lock lock bot locked and limited conversation to collaborators Jan 12, 2020
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.

3 participants