Add missing PRESSURE_BAR conversion (#54497)

* Add missing PRESSURE_BAR

* style

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* valid units

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
This commit is contained in:
Daniel Hjelseth Høyer 2021-08-12 07:30:35 +02:00 committed by GitHub
parent c040be423a
commit 49a69d5ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ from numbers import Number
from homeassistant.const import (
PRESSURE,
PRESSURE_BAR,
PRESSURE_HPA,
PRESSURE_INHG,
PRESSURE_MBAR,
@ -16,6 +17,7 @@ from homeassistant.const import (
VALID_UNITS: tuple[str, ...] = (
PRESSURE_PA,
PRESSURE_HPA,
PRESSURE_BAR,
PRESSURE_MBAR,
PRESSURE_INHG,
PRESSURE_PSI,
@ -24,6 +26,7 @@ VALID_UNITS: tuple[str, ...] = (
UNIT_CONVERSION: dict[str, float] = {
PRESSURE_PA: 1,
PRESSURE_HPA: 1 / 100,
PRESSURE_BAR: 1 / 100000,
PRESSURE_MBAR: 1 / 100,
PRESSURE_INHG: 1 / 3386.389,
PRESSURE_PSI: 1 / 6894.757,