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

Eight Sleep add REM type, Update async syntax, Catch API quirks #14937

Merged
merged 1 commit into from Jun 15, 2018

Conversation

Projects
None yet
5 participants
@mezz64
Contributor

mezz64 commented Jun 12, 2018

Description:

Bump pyEight version and add atributes to support new REM sleep type.
Update to new async syntax.
Catch possible None values for temperature before rounding.

Remove "Last in Bed" attribute since it is no longer updated accurately in the API. This is a breaking change for anyone using that attribute in an automation.

Related issue (if applicable): fixes #14492

Pull request in home-assistant.github.io with documentation (if applicable): N/A

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

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.
@@ -255,15 +269,17 @@ def state(self):
"""Return the state of the sensor."""
return self._state
@asyncio.coroutine
def async_update(self):
async def async_update(self):
"""Retrieve latest state."""
_LOGGER.debug("Updating Room sensor: %s", self._sensor)
temp = self._eight.room_temperature()

This comment has been minimized.

@bachya

bachya Jun 14, 2018

Contributor

Does this method call do any I/O? If it does and it's not awaited properly, you're going to lock the event loop.

This comment has been minimized.

@mezz64

mezz64 Jun 15, 2018

Contributor

It does not. All the I/O happens in the async_update_heat_data and async_update_user_data functions in the master component file. You can see the library room_temperature() function here: https://github.com/mezz64/pyEight/blob/d6c8e351acb9e43fd88be045d23ea4c6111bc8ff/pyeight/eight.py#L172

@balloob balloob merged commit 9efa31e into home-assistant:dev Jun 15, 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.003%) to 93.998%
Details

@wafflebot wafflebot bot removed the in progress label Jun 15, 2018

@balloob balloob referenced this pull request Jun 22, 2018

Merged

0.72 #15088

MizterB added a commit to MizterB/home-assistant that referenced this pull request Aug 11, 2018

cyberjacob pushed a commit to cyberjacob/home-assistant that referenced this pull request Sep 4, 2018

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