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

Support ppb and ppm for VOC reporting in Home Assistant #22895

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

agoode
Copy link
Contributor

@agoode agoode commented Jun 2, 2024

@@ -908,10 +908,15 @@ export default class HomeAssistant extends Extension {
delete discoveryEntry.discovery_payload.device_class;
}

// Home Assistant only supports µg/m³, not other units like ppb.
// Home Assistant uses a different voc device_class for µg/m³ versus ppb or ppm.
// https://github.com/Koenkk/zigbee2mqtt/issues/16057
if (firstExpose.name === 'voc' && discoveryEntry.discovery_payload.unit_of_measurement !== 'µg/m³') {
Copy link
Owner

Choose a reason for hiding this comment

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

Let's do this around

...lookup[firstExpose.name],
and remove the complete if here.

@agoode
Copy link
Contributor Author

agoode commented Jun 3, 2024

Thank you! Does this look closer to what you are expecting?

@Koenkk Koenkk merged commit 40ad896 into Koenkk:dev Jun 3, 2024
11 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jun 3, 2024

Perfect, thanks!

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.

None yet

2 participants