Skip to content
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

Add sensor to gardena #96691

Merged
merged 3 commits into from
Jul 17, 2023
Merged

Add sensor to gardena #96691

merged 3 commits into from
Jul 17, 2023

Conversation

elupus
Copy link
Contributor

@elupus elupus commented Jul 16, 2023

Proposed change

Add sensor entity to gardena bluetooth with battery information and timestamp of closure.

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

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
  • I have followed the perfect PR recommendations
  • 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

Some initial feedback

homeassistant/components/gardena_bluetooth/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/gardena_bluetooth/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft July 16, 2023 11:12
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

More feedback

@elupus elupus force-pushed the gardena/sensor branch 2 times, most recently from 371de75 to be15073 Compare July 16, 2023 11:44
@elupus elupus marked this pull request as ready for review July 16, 2023 11:45
@home-assistant home-assistant bot requested a review from joostlek July 16, 2023 11:45
@joostlek
Copy link
Member

LGTM, but I'd like someone else to take a quick look to be completely confident

@elupus elupus dismissed joostlek’s stale review July 16, 2023 12:01

Okeyed in comment.

homeassistant/components/gardena_bluetooth/sensor.py Outdated Show resolved Hide resolved
def _handle_coordinator_update(self) -> None:
value = self.coordinator.read_cached(self.entity_description.char)
if isinstance(value, datetime):
value = value.replace(
Copy link
Member

Choose a reason for hiding this comment

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

It would be better if the library provided times natively in utc so we don't have to convert here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Device stores time in local time without knowledge about timezone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suppose i could pass in timezone for the client on start. I will ponder a solution for future lib updates. I do agree

@elupus elupus merged commit 088d04f into home-assistant:dev Jul 17, 2023
20 checks passed
@elupus elupus deleted the gardena/sensor branch July 17, 2023 07:11
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2023
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.

3 participants