core icon indicating copy to clipboard operation
core copied to clipboard

Add account sensors to electric kiwi integration

Open mikey0000 opened this issue 2 years ago • 12 comments
trafficstars

Breaking change

Proposed change

Add additional Account sensor entities for balance and expenses as well as hour of free power savings percentage.

total running balance total account balance next billing date hop (how much power you've saved) percentage

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [x] 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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/28429

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] I have followed the perfect PR recommendations
  • [x] 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:

mikey0000 avatar Aug 03 '23 10:08 mikey0000

Need advice, I can add in all the unit tests I've written here, or do it in a seperate PR?

mikey0000 avatar Aug 03 '23 21:08 mikey0000

Are they for the new sensor(s) then add them here. For other things do it in separate PR.

gjohansson-ST avatar Aug 03 '23 21:08 gjohansson-ST

Are they for the new sensor(s) then add them here. For other things do it in separate PR.

unfortunately they cover both existing sensor entities (excludes select at the moment) and this PR. I'm looking at how to split them apart but coverage wouldn't be good.

mikey0000 avatar Aug 03 '23 21:08 mikey0000

Then for the existing (per platform if different) make PR's for existing setting this PR in draft. Once those has merged we can come back and do this one. You can ping me in the one you're making for sensor if you want.

gjohansson-ST avatar Aug 03 '23 21:08 gjohansson-ST

Note to self test time stuff with async_fire_time_changed for holistic changes to sensor HOP times.

mikey0000 avatar Sep 10 '23 07:09 mikey0000

Would love to see this progress, looks like you were awaiting the merge of #97723 but with this being merged now could this integration pr be revisited? 🙏

Codex- avatar Oct 04 '23 23:10 Codex-

PR needs a rebase. Would you continue your work here @mikey0000 👍

gjohansson-ST avatar Dec 02 '23 22:12 gjohansson-ST

Yup I'll get this fixed up

mikey0000 avatar Dec 03 '23 05:12 mikey0000

Would love to see this progress, looks like you were awaiting the merge of #97723 but with this being merged now could this integration pr be revisited? 🙏

Hey sorry this fell off the radar, will sort it out.

mikey0000 avatar Dec 03 '23 05:12 mikey0000

PR needs a rebase. Would you continue your work here @mikey0000 👍

Hey I've rebased but two tests are failing and I have absolutely no idea why. Python isn't my daily dev language, I'm stumped, help please! It looks like something isn't being awaited properly (race condition) but I cannot work it out.

mikey0000 avatar Dec 23 '23 23:12 mikey0000

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

Learn more about our pull request process.

home-assistant[bot] avatar Dec 25 '23 12:12 home-assistant[bot]

Tests are failing

Yes I've tried several times to figure out why, I just don't know why they are failing it's something wrong with how I'm setting up the mocks or async setup. I'll try get some help in discord perhaps

mikey0000 avatar Dec 25 '23 18:12 mikey0000

Don't forget to set as "ready for review" if you believe it is or no one will look at it. Thanks 👍

gjohansson-ST avatar Dec 29 '23 12:12 gjohansson-ST

Don't forget to set as "ready for review" if you believe it is or no one will look at it. Thanks 👍

Been away at a funeral, so wasn't high on my list. But thanks for the prompt

mikey0000 avatar Dec 29 '23 21:12 mikey0000