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

use UnitOfConductivity.MICROSIEMENS #1425

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading