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

Allow multiple configs for srp energy #96573

Merged
merged 5 commits into from Dec 14, 2023

Conversation

briglx
Copy link
Contributor

@briglx briglx commented Jul 15, 2023

Breaking change

Proposed change

Allow multiple configurations for different locations. This includes adding a separate device for each location. The sensor name uses the device name to distinguish between the two energy consumption sensors.

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.

The tests are still failing, can you take a look?

@home-assistant home-assistant bot marked this pull request as draft July 15, 2023 00:55
@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.

@briglx briglx marked this pull request as ready for review July 17, 2023 23:32
@home-assistant home-assistant bot requested a review from joostlek July 17, 2023 23:32
@gjohansson-ST
Copy link
Member

How is this PR solving the issue by adding a location name?
Also why would there be a good thing to add multiple entries just with different location names?

@briglx
Copy link
Contributor Author

briglx commented Aug 22, 2023

@gjohansson-ST This is part of an overall update to the integration that is split out between several PRs. This is an energy integration where a user could have several different homes/locations to monitor their energy. Part of the reason why there is an issue is because of the way the upgrade to the integration is split out between multiple PRs

@briglx
Copy link
Contributor Author

briglx commented Aug 22, 2023

@joostlek it's been a while since you asked for code changes. I've made the changes. Can you please review and approve?

homeassistant/components/srp_energy/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft August 22, 2023 06:47
@briglx briglx force-pushed the srp_energy_202307.coordinator branch from e75f2be to 69ebef4 Compare August 22, 2023 15:54
@frenck
Copy link
Member

frenck commented Oct 8, 2023

A small and friendly notification.

Are you planning on moving forward on this PR?
I didn't see any activity recently, while there are still things to do. I hope you consider picking it up soon! 👍

../Frenck

@briglx
Copy link
Contributor Author

briglx commented Oct 16, 2023

@frenck yes, I'll take a look this week. Thanks

@briglx briglx force-pushed the srp_energy_202307.coordinator branch from bbd724f to 152979c Compare October 17, 2023 23:22
@briglx briglx marked this pull request as ready for review October 17, 2023 23:38
@briglx
Copy link
Contributor Author

briglx commented Oct 17, 2023

@gjohansson-ST and @joostlek can you please check the review?

@briglx
Copy link
Contributor Author

briglx commented Nov 22, 2023

@frenck can you help move this forward. All the changes have been made. Just need a final review

homeassistant/components/srp_energy/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/const.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/srp_energy/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft November 24, 2023 18:25
@briglx briglx force-pushed the srp_energy_202307.coordinator branch from 2940af4 to a00664c Compare December 13, 2023 21:55
@briglx briglx marked this pull request as ready for review December 13, 2023 22:03
@briglx
Copy link
Contributor Author

briglx commented Dec 13, 2023

@gjohansson-ST let me know if you have any more concerns or feedback.

Copy link
Contributor

@emontnemery emontnemery 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 @briglx 👍

@emontnemery emontnemery dismissed stale reviews from joostlek and gjohansson-ST December 14, 2023 10:06

stale

@emontnemery emontnemery merged commit 7721840 into home-assistant:dev Dec 14, 2023
23 checks passed
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.

Please address the comments in a new PR. Thanks!

@@ -17,7 +17,7 @@
"unknown": "[%key:common::config_flow::error::unknown%]"
},
"abort": {
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]"
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
Copy link
Member

Choose a reason for hiding this comment

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

Change the reference to already_configured_service.

return self.async_show_form(
step_id="user",
data_schema=vol.Schema(
{
vol.Required(
CONF_NAME, default=self.hass.config.location_name
Copy link
Member

Choose a reason for hiding this comment

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

Don't ask for the name here. Just default the title to the location name. The user can change the config entry title afterwards if they want.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 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.

srp_engry doesn't create any devices or entities
6 participants