Skip to content

Commit

Permalink
use UnitOfConductivity.MICROSIEMENS
Browse files Browse the repository at this point in the history
  • Loading branch information
caibinqing committed Aug 18, 2024
1 parent 0396b1d commit 430e85b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/xiaomi_gateway3/hass/entity_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from homeassistant.const import (
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_BILLION,
CONDUCTIVITY,
LIGHT_LUX,
MAJOR_VERSION,
MINOR_VERSION,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
UnitOfElectricPotential,
Expand All @@ -22,6 +23,12 @@
)
from homeassistant.helpers.entity import Entity, EntityCategory

if (MAJOR_VERSION, MINOR_VERSION) >= (2024, 7):
from homeassistant.const import UnitOfConductivity
CONDUCTIVITY = UnitOfConductivity.MICROSIEMENS
else:
from homeassistant.const import CONDUCTIVITY

from ..core.converters.base import BaseConv

# just to reduce the code
Expand Down

0 comments on commit 430e85b

Please sign in to comment.