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 sensors platform to Watergate integration #133015

Merged

Conversation

adam-the-hero
Copy link
Contributor

Breaking change

Proposed change

Adding additional entities for Watergate integration.

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 Ruff (ruff format 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.

To help with the load of incoming pull requests:

@adam-the-hero
Copy link
Contributor Author

For reviewers: I left two questions in the code, because it is kinda weird for me and I do not want to reinvent a wheel if you think I should do it in a different way.

@home-assistant home-assistant bot marked this pull request as draft December 12, 2024 10:52
@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.

homeassistant/components/watergate/quality_scale.yaml Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
coordinator,
FLOW_SENSOR_NAME,
FLOW_ENTITY_NAME,
lambda data: (data.telemetry.flow / 1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if you use unit_of_measurement and native_unit_of_measurement HA will do the transformation for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well there is no MILLILITERS_PER_MINUTE, so probably transformation will not work that easy, do you want me to include this new unit in this PR?

homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
@adam-the-hero adam-the-hero force-pushed the add-watergate-sensors-to-integration branch from ca4e537 to e18f266 Compare December 12, 2024 14:38
@adam-the-hero adam-the-hero force-pushed the add-watergate-sensors-to-integration branch from e18f266 to 0a0cd9e Compare December 12, 2024 14:39
@adam-the-hero adam-the-hero marked this pull request as ready for review December 12, 2024 14:40
@home-assistant home-assistant bot requested a review from joostlek December 12, 2024 14:40
Copy link
Contributor

@epenet epenet left a comment

Choose a reason for hiding this comment

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

Please also avoid squashing the commits, as it makes the review process more complicated.

@epenet epenet marked this pull request as draft December 12, 2024 14:52
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/strings.json Outdated Show resolved Hide resolved
homeassistant/components/watergate/strings.json Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
@adam-the-hero adam-the-hero marked this pull request as ready for review December 12, 2024 18:57
@adam-the-hero adam-the-hero marked this pull request as ready for review December 17, 2024 20:09
@home-assistant home-assistant bot requested a review from joostlek December 17, 2024 20:09
homeassistant/components/watergate/strings.json Outdated Show resolved Hide resolved
homeassistant/components/watergate/strings.json Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
@zweckj zweckj marked this pull request as draft December 17, 2024 20:25
… handlers in entity. Rename uptime entities to up since.
@adam-the-hero adam-the-hero marked this pull request as ready for review December 18, 2024 07:57
@home-assistant home-assistant bot requested a review from zweckj December 18, 2024 07:57
homeassistant/components/watergate/strings.json Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 18, 2024 09:13
@adam-the-hero adam-the-hero marked this pull request as ready for review December 18, 2024 09:32
@home-assistant home-assistant bot requested a review from zweckj December 18, 2024 09:32
@adam-the-hero
Copy link
Contributor Author

I would like to say sorry for being pain in the neck with all those bad stuff you are discovering here but I am learning the whole eco system. Thanks for keeping the high quality of the whole code.

Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

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

minor cleanups

homeassistant/components/watergate/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 18, 2024 09:41
@adam-the-hero adam-the-hero marked this pull request as ready for review December 18, 2024 10:38
@home-assistant home-assistant bot requested a review from zweckj December 18, 2024 10:38
Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 👍

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.

Final things, after this we can merge :)

homeassistant/components/watergate/entity.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/watergate/strings.json Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 18, 2024 13:05
@adam-the-hero adam-the-hero marked this pull request as ready for review December 18, 2024 13:46
@home-assistant home-assistant bot requested review from joostlek and zweckj December 18, 2024 13:46
@joostlek joostlek merged commit 943b1d9 into home-assistant:dev Dec 18, 2024
30 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2024
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