Skip to content

Commit b9f19eb

Browse files
authored
Merge pull request #1425 from Necroneco/conductivity
use UnitOfConductivity.MICROSIEMENS
2 parents 0f64389 + 430e85b commit b9f19eb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

custom_components/xiaomi_gateway3/hass/entity_description.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
from homeassistant.const import (
88
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
99
CONCENTRATION_PARTS_PER_BILLION,
10-
CONDUCTIVITY,
1110
LIGHT_LUX,
11+
MAJOR_VERSION,
12+
MINOR_VERSION,
1213
PERCENTAGE,
1314
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
1415
UnitOfElectricPotential,
@@ -22,6 +23,12 @@
2223
)
2324
from homeassistant.helpers.entity import Entity, EntityCategory
2425

26+
if (MAJOR_VERSION, MINOR_VERSION) >= (2024, 7):
27+
from homeassistant.const import UnitOfConductivity
28+
CONDUCTIVITY = UnitOfConductivity.MICROSIEMENS
29+
else:
30+
from homeassistant.const import CONDUCTIVITY
31+
2532
from ..core.converters.base import BaseConv
2633

2734
# just to reduce the code

0 commit comments

Comments
 (0)