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

Convert songpal to use asynchronous websocket for state updates #19129

Merged
merged 7 commits into from Dec 12, 2018

Conversation

Projects
None yet
5 participants
@rytilahti
Copy link
Contributor

rytilahti commented Dec 8, 2018

Description:

This PR converts songpal platform to use the websocket interface for instantaneous updates on state changes.

Related issue (if applicable): fixes #

Example entry for configuration.yaml (if applicable):

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.

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

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

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

rytilahti added some commits Dec 9, 2018

add backoff timer for reconnects, fix variable naming (I thought that…
… this wouldn't matter for internals..)

@rytilahti rytilahti changed the title Add websocket-based non-polling variant for songpal Convert songpal to use asynchronous websocket for state updates Dec 9, 2018

@MartinHjelmare
Copy link
Member

MartinHjelmare left a comment

Looks good! Just two small comments.

@property
def should_poll(self):
"""Return True if the device should be polled."""
return self._poll

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Dec 9, 2018

Member

Should we keep the attribute?

This comment has been minimized.

@rytilahti

rytilahti Dec 9, 2018

Contributor

I'd prefer keeping it around for the time being, if someone comes up with a broken setup it makes it easy to check if the polling variant would work in that case.


self._available = True

# activate notifications if wanted
if not self._poll:

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Dec 9, 2018

Member

Can we remove this check?

This comment has been minimized.

@rytilahti

rytilahti Dec 9, 2018

Contributor

See above. If you think it's better to remove it, I'll do that.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 9, 2018

I think we can merge.

@balloob balloob merged commit 2fc0dfe into home-assistant:dev Dec 12, 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 decreased (-0.0002%) to 92.933%
Details

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

@rytilahti rytilahti deleted the rytilahti:songpal_nonpolling branch Dec 12, 2018

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

Convert songpal to use asynchronous websocket for state updates (home…
…-assistant#19129)

* Add websocket-based non-polling variant for songpal

* linting fixes

* changes based on Martin's feedback

* Fix linting

* add backoff timer for reconnects, fix variable naming (I thought that this wouldn't matter for internals..)

* Remove poll configuration variable

* bump the version just to be sure, the previous release lacked a version file (required for setup.py)

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

rytilahti added a commit to home-assistant/home-assistant.io that referenced this pull request Jan 20, 2019

update ha_iot_class for songpal
Songpal defaults to local push since home-assistant/home-assistant#19129 .

@rytilahti rytilahti referenced this pull request Jan 20, 2019

Merged

update ha_iot_class for songpal #8221

0 of 2 tasks complete

fabaff added a commit to home-assistant/home-assistant.io that referenced this pull request Jan 20, 2019

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