Skip to content

Conversation

@mvn23
Copy link
Contributor

@mvn23 mvn23 commented Mar 2, 2020

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

This PR adds support for detecting availability of the gateway and/or sensor data.
So far only sensor and binary_sensor entities will report whether or not their data is included in the status report. The climate entity is now prepared for support as well, but it will require an update of the pyotgw library before it starts working. This update will be provided in a separate PR.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

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

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@mvn23
Copy link
Contributor Author

mvn23 commented Mar 2, 2020

Failed tests seem unrelated. Can anyone confirm?

@basnijholt
Copy link
Contributor

@mvn23, I have the same thing in #31967.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good! Just a small clean up.

@callback
def receive_report(self, status):
"""Receive and handle a new report from the Gateway."""
self._available = status != {}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self._available = status != {}
self._available = bool(status)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, I will take care of it tomorrow.

@mvn23 mvn23 force-pushed the otgw_availability branch from 0b9b1d6 to 51d279e Compare April 2, 2020 07:55
@mvn23
Copy link
Contributor Author

mvn23 commented Apr 2, 2020

Comment addressed and rebased on latest dev.
Failed tests seem to be related to TTS, which was not changed in this PR.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Thanks!

@MartinHjelmare
Copy link
Member

Test failures are unrelated as noted above. Merging.

@MartinHjelmare MartinHjelmare merged commit 58ae117 into home-assistant:dev Apr 2, 2020
@mvn23 mvn23 deleted the otgw_availability branch April 2, 2020 09:29
@mvn23 mvn23 mentioned this pull request Apr 2, 2020
20 tasks
@lock lock bot locked and limited conversation to collaborators Apr 4, 2020
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.

5 participants