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 battery sensor to ohme #134222

Merged
merged 5 commits into from
Dec 30, 2024
Merged

Add battery sensor to ohme #134222

merged 5 commits into from
Dec 30, 2024

Conversation

dan-r
Copy link
Contributor

@dan-r dan-r commented Dec 29, 2024

Proposed change

Add battery sensor to Ohme. Not too sure on the approach here as the battery is actually for the connected car rather than the device itself...

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:

Comment on lines 70 to 71
key="battery",
native_unit_of_measurement=PERCENTAGE,
Copy link
Member

Choose a reason for hiding this comment

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

You can use translation keys to mention that this is for the connected vehicle

Copy link
Member

Choose a reason for hiding this comment

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

Also, if the vehicle is disconnected, what does it show

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. When nothing is connected it'll either:

  • Still show the up to date battery % - if you've linked the car with the charger in the manufacturers app,
    or
  • Show the amount of charge added in the last session - if no car is linked

Either way, its showing what you would get if you looked in the Ohme app, charging or not.

@dan-r
Copy link
Contributor Author

dan-r commented Dec 29, 2024

Oops forgot to update those snapshots. Also changed car to vehicle, seems like a better term as it could be a van/some other vehicle.

@zweckj zweckj merged commit a0fb6df into home-assistant:dev Dec 30, 2024
34 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 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.

3 participants