Skip to content

Update Insight parameters using the subscription data.#6782

Merged
pvizeli merged 3 commits into
devfrom
update_wemo
Mar 27, 2017
Merged

Update Insight parameters using the subscription data.#6782
pvizeli merged 3 commits into
devfrom
update_wemo

Conversation

@pavoni
Copy link
Copy Markdown
Contributor

@pavoni pavoni commented Mar 25, 2017

Description:

The subscription model of the wemo insight switch worked by receiving an alert when the state changed - HA then went to fetch the updated data.

The recent change to update power useage every second caused a lot more traffic - which on my unreliable network can lead to lost subscriptions.

This PR updates the pywemo library and the HA device so that the data in the wemo updates is used to directly update the device state - avoiding a round trip to the device.

Would be grateful for some help testing.

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

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

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New 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:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link
Copy Markdown

@pavoni, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @jaharkes and @fabaff to be potential reviewers.

Comment thread homeassistant/components/switch/wemo.py Outdated
except AttributeError:
_LOGGER.warning('Could not update status for %s', self.name)
except AttributeError as err:
_LOGGER.warning('Could not update status for %s (%s)', self.name, err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (82 > 79 characters)

Comment thread homeassistant/components/switch/wemo.py Outdated
_LOGGER.warning('Could not update status for %s', self.name)
except AttributeError as err:
_LOGGER.warning('Could not update status for %s (%s)',
self.name, err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

continuation line under-indented for visual indent

@pavoni
Copy link
Copy Markdown
Contributor Author

pavoni commented Mar 25, 2017

@stu-gott Thanks for your super fast feedback on the pywemo PR. Could you check this still works OK with your CoffeeMaker?

@pvizeli pvizeli merged commit c53de19 into dev Mar 27, 2017
@pavoni pavoni deleted the update_wemo branch March 27, 2017 17:06
@fabaff fabaff mentioned this pull request Apr 6, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
@ghost ghost removed the platform: switch.wemo label Mar 21, 2019
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.

6 participants