Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Merged
merged 1 commit into from
Jun 15, 2018

Conversation

mezz64
Copy link
Contributor

@mezz64 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()
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

@mezz64 mezz64 Jun 15, 2018

Choose a reason for hiding this comment

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

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
@ghost ghost removed the in progress label Jun 15, 2018
@balloob balloob mentioned this pull request Jun 22, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
@mezz64 mezz64 deleted the eight-0.0.9 branch February 15, 2019 04:31
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.

Eight component error since 0.69.x
5 participants