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

feat: initial implementation #1

Merged
merged 4 commits into from
Aug 30, 2022

Conversation

apt-itude
Copy link
Collaborator

Initial implementation of parser for Tilt Hydrometer devices to be used by Home Assistant integration.

This has been running successfully as part of a custom component on my Home Assistant for a few weeks now.

@Ernst79 Apologies: I let the invite to contribute directly to the upstream repo expire

Comment on lines +86 to +88
key=DEVICE_CLASS_SG,
device_class=DEVICE_CLASS_SG,
native_unit_of_measurement=UNITS_SG,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't sure what to do about device class and units for this sensor. The device class is relatively unusual (specific gravity) and it's really unit-less, but from what I can tell omitting units doesn't work so well in HA.

Do I need to define this in the sensor-state-data library first?

Copy link
Member

Choose a reason for hiding this comment

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

Yes it needs something in sensor state data first

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Can it actually be unit-less, or do I just need to make something up? Like G?

Copy link
Member

Choose a reason for hiding this comment

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

When you bring it into Home Assistant, map the units to None

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the device class should also send None to HA, isn’t it? Specific gravity is not a HA device class.

@apt-itude apt-itude force-pushed the initial-implementation branch from 9f4892c to 65319fa Compare August 30, 2022 00:31
@bdraco bdraco changed the title Initial implementation feat: initial implementation Aug 30, 2022
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@bdraco bdraco merged commit d770f6a into Bluetooth-Devices:main Aug 30, 2022
@bdraco
Copy link
Member

bdraco commented Aug 30, 2022

@apt-itude What is your PyPI handle?

@bdraco
Copy link
Member

bdraco commented Aug 30, 2022

@apt-itude I'm on holiday starting tomorrow so I didn't want to leave you hanging.

I got the auto publication workflow and tokens working so as long as the CI passes it should publish new changes based on the commit message format. (https://www.conventionalcommits.org/en/v1.0.0-beta.2/#summary)

@Ernst79 can add you to the PyPI package.

@apt-itude
Copy link
Collaborator Author

@apt-itude What is your PyPI handle?

In case you still need it, same as here: apt-itude

@apt-itude apt-itude deleted the initial-implementation branch August 30, 2022 21:07
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.

3 participants