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 a battery sensor to battery powered devices #234

Merged
merged 48 commits into from
Aug 18, 2023

Conversation

stefanbode
Copy link
Contributor

This should work without modifications in HA and enable the battery magic in HA.

Tasmota Command:
batterypercentage 45 to set something. restart 1 required if not enabled before

batterypercentage 101 to disable battery., restart 1 required

@emontnemery emontnemery changed the title Battery enabled Add a battery sensor to battery powered devices Aug 18, 2023
Copy link
Owner

@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.

This is great!

I added some suggested changes though:

  • Let's remove the deep sleep related changes from this PR.
  • I also think we should better separate the battery percentage sensor from a "normal" battery sensor, hence a separate constant for that

hatasmota/const.py Outdated Show resolved Hide resolved
hatasmota/const.py Outdated Show resolved Hide resolved
hatasmota/const.py Outdated Show resolved Hide resolved
hatasmota/device_status.py Outdated Show resolved Hide resolved
hatasmota/discovery.py Outdated Show resolved Hide resolved
hatasmota/status_sensor.py Show resolved Hide resolved
hatasmota/status_sensor.py Outdated Show resolved Hide resolved
hatasmota/status_sensor.py Outdated Show resolved Hide resolved
hatasmota/status_sensor.py Outdated Show resolved Hide resolved
hatasmota/status_sensor.py Outdated Show resolved Hide resolved
stefanbode and others added 13 commits August 18, 2023 14:04
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
@stefanbode
Copy link
Contributor Author

All changes accepted

hatasmota/discovery.py Outdated Show resolved Hide resolved
Copy link
Owner

@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.

Thanks a lot, @stefanbode 👍

@emontnemery emontnemery merged commit 1d6f160 into emontnemery:master Aug 18, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants