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

Correct calls to subscription.async_unsubscribe_topics #19414

Merged
merged 3 commits into from Dec 19, 2018

Conversation

Projects
None yet
5 participants
@emontnemery
Copy link
Contributor

emontnemery commented Dec 17, 2018

Description:

Fix subscription.async_unsubscribe_topics to return the new (empty) subscription state
Also, when calling subscription.async_unsubscribe_topics, update the entity's subscription state

Background:

When Entity registry is called, async_registry_updated(self, old, new) in helpers/entity.py is called.
If entity_id is changed, this will first remove, and then again add, the entity.

Related issue (if applicable): fixes #19352

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.

@emontnemery emontnemery requested a review from home-assistant/core as a code owner Dec 17, 2018

@wafflebot wafflebot bot added the in progress label Dec 17, 2018

@emontnemery emontnemery added this to the 0.84.3 milestone Dec 17, 2018

@emontnemery emontnemery modified the milestones: 0.84.3, 0.84.4 Dec 17, 2018

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 17, 2018

We should add tests.

@OttoWinter OttoWinter referenced this pull request Dec 18, 2018

Merged

Miscellaneous ESPHome cleanups #19425

3 of 3 tasks complete
@balloob

This comment has been minimized.

Copy link
Member

balloob commented Dec 18, 2018

Yeah this should have been caught by tests. Please include a test to test this.

@emontnemery emontnemery force-pushed the emontnemery:fix_async_unsubscribe_topics branch from 9d5d20f to 6d22d43 Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@home-assistant home-assistant deleted a comment from houndci-bot Dec 18, 2018

@emontnemery

This comment has been minimized.

Copy link
Contributor

emontnemery commented Dec 18, 2018

Test cases added.
(And I messed up a bit when pushing the testcases, Hound was not impressed)

@emontnemery emontnemery force-pushed the emontnemery:fix_async_unsubscribe_topics branch from 6d22d43 to 5aa5e1b Dec 19, 2018

@balloob balloob merged commit 1568de6 into home-assistant:dev Dec 19, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 93.045%
Details

@wafflebot wafflebot bot removed the in progress label Dec 19, 2018

@balloob balloob removed this from the 0.84.4 milestone Dec 19, 2018

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Dec 19, 2018

Cleared milestone as it does not cleanly apply to master

@emontnemery

This comment has been minimized.

Copy link
Contributor

emontnemery commented Dec 19, 2018

OK. Should I open a PR which does apply to master, or this can wait for 0.85?

@balloob

This comment has been minimized.

Copy link
Member

balloob commented Dec 19, 2018

Let's wait for 85, I can't do another hot fix or I'll go crazy.

@emontnemery emontnemery deleted the emontnemery:fix_async_unsubscribe_topics branch Dec 19, 2018

mxworm added a commit to mxworm/home-assistant that referenced this pull request Dec 21, 2018

Merge branch 'dev' into current
* dev: (75 commits)
  Add native ESPHome Home Assistant state feature (home-assistant#19429)
  Add new sensor platform to expose Islamic prayer times (home-assistant#19444)
  Add timeout to RainMachine login (home-assistant#19476)
  Reorder FLOW entries in config_entries.py (home-assistant#19475)
  Update pynetgear to 0.5.2 (home-assistant#19490)
  Rename ocr.png to ssocr-(entity_name).png to allow multiple instances (home-assistant#18634)
  Add Mythic Beasts DNSAPI Component (home-assistant#18333)
  Adds battery_percent which had been introduced with pyatmo 1.4 and resolves unknown var warning. (home-assistant#19309)
  Bump Pybotvac To Support D7 On Latest Firmware (home-assistant#19463)
  Add device registry to MQTT alarm control panel (home-assistant#19331)
  Add device registry to MQTT lock (home-assistant#19333)
  Bump pyharmony (home-assistant#19460)
  Add testcase test_entity_id_update
  Add device registry to MQTT climate
  Updated frontend to 20181219.0
  Update translations
  ZHA entity ZCL reporting configuration (home-assistant#19177)
  Use web sockets for Harmony HUB (home-assistant#19440)
  Correct calls to subscription.async_unsubscribe_topics (home-assistant#19414)
  Various updates (home-assistant#19449)
  ...

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

Correct calls to subscription.async_unsubscribe_topics (home-assistan…
…t#19414)

* Correct calls to subscription.async_unsubscribe_topics

* Review comments

* Add testcases

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment