Use UnitOfPressure in integrations (#84230)
This commit is contained in:
parent
0ccac69ce1
commit
f988a1164d
27 changed files with 72 additions and 68 deletions
|
@ -16,8 +16,8 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.device_registry import DeviceEntryType
|
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||||
|
@ -105,7 +105,7 @@ SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
|
||||||
key=ATTR_API_PRESSURE,
|
key=ATTR_API_PRESSURE,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name=ATTR_API_PRESSURE.capitalize(),
|
name=ATTR_API_PRESSURE.capitalize(),
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
AirlySensorEntityDescription(
|
AirlySensorEntityDescription(
|
||||||
|
|
|
@ -15,9 +15,9 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_BILLION,
|
CONCENTRATION_PARTS_PER_BILLION,
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_MBAR,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS,
|
SIGNAL_STRENGTH_DECIBELS,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
|
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
|
||||||
|
@ -51,7 +51,7 @@ SENSORS: dict[str, SensorEntityDescription] = {
|
||||||
"pressure": SensorEntityDescription(
|
"pressure": SensorEntityDescription(
|
||||||
key="pressure",
|
key="pressure",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
),
|
),
|
||||||
"battery": SensorEntityDescription(
|
"battery": SensorEntityDescription(
|
||||||
|
|
|
@ -17,8 +17,8 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_MBAR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.device_registry import CONNECTION_BLUETOOTH
|
from homeassistant.helpers.device_registry import CONNECTION_BLUETOOTH
|
||||||
|
@ -75,7 +75,7 @@ SENSORS_MAPPING_TEMPLATE: dict[str, SensorEntityDescription] = {
|
||||||
"pressure": SensorEntityDescription(
|
"pressure": SensorEntityDescription(
|
||||||
key="pressure",
|
key="pressure",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
),
|
),
|
||||||
"battery": SensorEntityDescription(
|
"battery": SensorEntityDescription(
|
||||||
|
|
|
@ -25,9 +25,9 @@ from homeassistant.const import (
|
||||||
ATTR_SW_VERSION,
|
ATTR_SW_VERSION,
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TIME_SECONDS,
|
TIME_SECONDS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
@ -54,7 +54,7 @@ SENSOR_DESCRIPTIONS = {
|
||||||
key="pressure",
|
key="pressure",
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
"co2": SensorEntityDescription(
|
"co2": SensorEntityDescription(
|
||||||
|
|
|
@ -3,10 +3,10 @@ from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_BAR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
TIME_HOURS,
|
TIME_HOURS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -48,7 +48,7 @@ class AtagSensor(AtagEntity, SensorEntity):
|
||||||
):
|
):
|
||||||
self._attr_device_class = coordinator.data.report[self._id].sensorclass
|
self._attr_device_class = coordinator.data.report[self._id].sensorclass
|
||||||
if coordinator.data.report[self._id].measure in (
|
if coordinator.data.report[self._id].measure in (
|
||||||
PRESSURE_BAR,
|
UnitOfPressure.BAR,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
|
|
|
@ -24,9 +24,9 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_MBAR,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
@ -85,7 +85,7 @@ SENSOR_DESCRIPTIONS = {
|
||||||
): SensorEntityDescription(
|
): SensorEntityDescription(
|
||||||
key=f"{BlueMaestroSensorDeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
key=f"{BlueMaestroSensorDeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,10 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_BILLION,
|
CONCENTRATION_PARTS_PER_BILLION,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfEnergy,
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
@ -190,7 +190,7 @@ ENTITY_DESCRIPTIONS: tuple[DeconzSensorDescription, ...] = (
|
||||||
instance_check=Pressure,
|
instance_check=Pressure,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
),
|
),
|
||||||
DeconzSensorDescription[Temperature](
|
DeconzSensorDescription[Temperature](
|
||||||
key="temperature",
|
key="temperature",
|
||||||
|
|
|
@ -7,7 +7,12 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PERCENTAGE, PRESSURE_PSI, TEMP_FAHRENHEIT, UnitOfVolume
|
from homeassistant.const import (
|
||||||
|
PERCENTAGE,
|
||||||
|
TEMP_FAHRENHEIT,
|
||||||
|
UnitOfPressure,
|
||||||
|
UnitOfVolume,
|
||||||
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
|
@ -160,7 +165,7 @@ class FloPressureSensor(FloEntity, SensorEntity):
|
||||||
"""Monitors the water pressure."""
|
"""Monitors the water pressure."""
|
||||||
|
|
||||||
_attr_device_class = SensorDeviceClass.PRESSURE
|
_attr_device_class = SensorDeviceClass.PRESSURE
|
||||||
_attr_native_unit_of_measurement = PRESSURE_PSI
|
_attr_native_unit_of_measurement = UnitOfPressure.PSI
|
||||||
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
|
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
|
||||||
|
|
||||||
def __init__(self, device):
|
def __init__(self, device):
|
||||||
|
|
|
@ -25,7 +25,6 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
Platform,
|
Platform,
|
||||||
|
@ -33,6 +32,7 @@ from homeassistant.const import (
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
UnitOfEnergy,
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
UnitOfSoundPressure,
|
UnitOfSoundPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
@ -216,7 +216,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
name="Air Pressure",
|
name="Air Pressure",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.VENDOR_VOCOLINC_OUTLET_ENERGY: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.VENDOR_VOCOLINC_OUTLET_ENERGY: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.VENDOR_VOCOLINC_OUTLET_ENERGY,
|
key=CharacteristicsTypes.VENDOR_VOCOLINC_OUTLET_ENERGY,
|
||||||
|
|
|
@ -17,7 +17,6 @@ from homeassistant.const import (
|
||||||
DEGREE,
|
DEGREE,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
@ -25,6 +24,7 @@ from homeassistant.const import (
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
UnitOfPrecipitationDepth,
|
UnitOfPrecipitationDepth,
|
||||||
|
UnitOfPressure,
|
||||||
UnitOfSpeed,
|
UnitOfSpeed,
|
||||||
UnitOfVolume,
|
UnitOfVolume,
|
||||||
)
|
)
|
||||||
|
@ -188,7 +188,7 @@ SENSOR_DESCRIPTIONS: dict[str, SensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
"AIR_PRESSURE": SensorEntityDescription(
|
"AIR_PRESSURE": SensorEntityDescription(
|
||||||
key="AIR_PRESSURE",
|
key="AIR_PRESSURE",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
|
|
@ -10,7 +10,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.const import PRESSURE_BAR, TEMP_CELSIUS
|
from homeassistant.const import TEMP_CELSIUS, UnitOfPressure
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
@ -35,7 +35,7 @@ SENSOR_TYPES: tuple[IncomfortSensorEntityDescription, ...] = (
|
||||||
key="pressure",
|
key="pressure",
|
||||||
name=INCOMFORT_PRESSURE,
|
name=INCOMFORT_PRESSURE,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_BAR,
|
native_unit_of_measurement=UnitOfPressure.BAR,
|
||||||
),
|
),
|
||||||
IncomfortSensorEntityDescription(
|
IncomfortSensorEntityDescription(
|
||||||
key="heater_temp",
|
key="heater_temp",
|
||||||
|
|
|
@ -14,9 +14,9 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_CLIENT_ID,
|
CONF_CLIENT_ID,
|
||||||
PRESSURE_BAR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TIME_HOURS,
|
TIME_HOURS,
|
||||||
|
UnitOfPressure,
|
||||||
UnitOfVolume,
|
UnitOfVolume,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -65,7 +65,7 @@ SENSOR_TYPES = (
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="pump_pressure",
|
key="pump_pressure",
|
||||||
name="Pump pressure",
|
name="Pump pressure",
|
||||||
native_unit_of_measurement=PRESSURE_BAR,
|
native_unit_of_measurement=UnitOfPressure.BAR,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
|
|
@ -16,8 +16,8 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
CONF_SHOW_ON_MAP,
|
CONF_SHOW_ON_MAP,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_PA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
@ -47,14 +47,14 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="pressure",
|
key="pressure",
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
native_unit_of_measurement=PRESSURE_PA,
|
native_unit_of_measurement=UnitOfPressure.PA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="pressure_at_sealevel",
|
key="pressure_at_sealevel",
|
||||||
name="Pressure at sealevel",
|
name="Pressure at sealevel",
|
||||||
native_unit_of_measurement=PRESSURE_PA,
|
native_unit_of_measurement=UnitOfPressure.PA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PERCENTAGE, PRESSURE_PSI, UnitOfLength
|
from homeassistant.const import PERCENTAGE, UnitOfLength, UnitOfPressure
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import StateType
|
from homeassistant.helpers.typing import StateType
|
||||||
|
@ -185,7 +185,7 @@ SENSOR_ENTITIES = [
|
||||||
name="Front left tire pressure",
|
name="Front left tire pressure",
|
||||||
icon="mdi:car-tire-alert",
|
icon="mdi:car-tire-alert",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_PSI,
|
native_unit_of_measurement=UnitOfPressure.PSI,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
is_supported=_front_left_tire_pressure_supported,
|
is_supported=_front_left_tire_pressure_supported,
|
||||||
value=_front_left_tire_pressure_value,
|
value=_front_left_tire_pressure_value,
|
||||||
|
@ -195,7 +195,7 @@ SENSOR_ENTITIES = [
|
||||||
name="Front right tire pressure",
|
name="Front right tire pressure",
|
||||||
icon="mdi:car-tire-alert",
|
icon="mdi:car-tire-alert",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_PSI,
|
native_unit_of_measurement=UnitOfPressure.PSI,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
is_supported=_front_right_tire_pressure_supported,
|
is_supported=_front_right_tire_pressure_supported,
|
||||||
value=_front_right_tire_pressure_value,
|
value=_front_right_tire_pressure_value,
|
||||||
|
@ -205,7 +205,7 @@ SENSOR_ENTITIES = [
|
||||||
name="Rear left tire pressure",
|
name="Rear left tire pressure",
|
||||||
icon="mdi:car-tire-alert",
|
icon="mdi:car-tire-alert",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_PSI,
|
native_unit_of_measurement=UnitOfPressure.PSI,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
is_supported=_rear_left_tire_pressure_supported,
|
is_supported=_rear_left_tire_pressure_supported,
|
||||||
value=_rear_left_tire_pressure_value,
|
value=_rear_left_tire_pressure_value,
|
||||||
|
@ -215,7 +215,7 @@ SENSOR_ENTITIES = [
|
||||||
name="Rear right tire pressure",
|
name="Rear right tire pressure",
|
||||||
icon="mdi:car-tire-alert",
|
icon="mdi:car-tire-alert",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_PSI,
|
native_unit_of_measurement=UnitOfPressure.PSI,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
is_supported=_rear_right_tire_pressure_supported,
|
is_supported=_rear_right_tire_pressure_supported,
|
||||||
value=_rear_right_tire_pressure_value,
|
value=_rear_right_tire_pressure_value,
|
||||||
|
|
|
@ -17,9 +17,9 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry
|
from homeassistant.helpers import entity_registry
|
||||||
|
@ -81,7 +81,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_BME280_PRESSURE,
|
key=ATTR_BME280_PRESSURE,
|
||||||
name="BME280 pressure",
|
name="BME280 pressure",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
@ -95,7 +95,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_BMP180_PRESSURE,
|
key=ATTR_BMP180_PRESSURE,
|
||||||
name="BMP180 pressure",
|
name="BMP180 pressure",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
@ -109,7 +109,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=ATTR_BMP280_PRESSURE,
|
key=ATTR_BMP280_PRESSURE,
|
||||||
name="BMP280 pressure",
|
name="BMP280 pressure",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
|
|
@ -12,7 +12,6 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_PSI,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
|
@ -20,6 +19,7 @@ from homeassistant.const import (
|
||||||
UnitOfEnergy,
|
UnitOfEnergy,
|
||||||
UnitOfFrequency,
|
UnitOfFrequency,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
@ -47,7 +47,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="EngineOilPressure",
|
key="EngineOilPressure",
|
||||||
native_unit_of_measurement=PRESSURE_PSI,
|
native_unit_of_measurement=UnitOfPressure.PSI,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
|
|
@ -19,10 +19,9 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_CBAR,
|
|
||||||
PRESSURE_MBAR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -95,7 +94,7 @@ DEVICE_SENSORS: dict[str, tuple[OneWireSensorEntityDescription, ...]] = {
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
read_mode=READ_MODE_FLOAT,
|
read_mode=READ_MODE_FLOAT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
@ -153,7 +152,7 @@ DEVICE_SENSORS: dict[str, tuple[OneWireSensorEntityDescription, ...]] = {
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
read_mode=READ_MODE_FLOAT,
|
read_mode=READ_MODE_FLOAT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
@ -284,7 +283,7 @@ HOBBYBOARD_EF: dict[str, tuple[OneWireSensorEntityDescription, ...]] = {
|
||||||
key=f"moisture/sensor.{id}",
|
key=f"moisture/sensor.{id}",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name=f"Moisture {id}",
|
name=f"Moisture {id}",
|
||||||
native_unit_of_measurement=PRESSURE_CBAR,
|
native_unit_of_measurement=UnitOfPressure.CBAR,
|
||||||
read_mode=READ_MODE_FLOAT,
|
read_mode=READ_MODE_FLOAT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
)
|
)
|
||||||
|
@ -308,7 +307,7 @@ EDS_SENSORS: dict[str, tuple[OneWireSensorEntityDescription, ...]] = {
|
||||||
key="EDS0066/pressure",
|
key="EDS0066/pressure",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
read_mode=READ_MODE_FLOAT,
|
read_mode=READ_MODE_FLOAT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
@ -326,7 +325,7 @@ EDS_SENSORS: dict[str, tuple[OneWireSensorEntityDescription, ...]] = {
|
||||||
key="EDS0068/pressure",
|
key="EDS0068/pressure",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name="Pressure",
|
name="Pressure",
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
read_mode=READ_MODE_FLOAT,
|
read_mode=READ_MODE_FLOAT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
|
|
@ -10,10 +10,10 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_BAR,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfEnergy,
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
UnitOfVolume,
|
UnitOfVolume,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -280,7 +280,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="water_pressure",
|
key="water_pressure",
|
||||||
name="Water pressure",
|
name="Water pressure",
|
||||||
native_unit_of_measurement=PRESSURE_BAR,
|
native_unit_of_measurement=UnitOfPressure.BAR,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
|
|
@ -27,9 +27,9 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_MBAR,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
@ -89,7 +89,7 @@ SENSOR_DESCRIPTIONS = {
|
||||||
(QingpingSensorDeviceClass.PRESSURE, Units.PRESSURE_MBAR): SensorEntityDescription(
|
(QingpingSensorDeviceClass.PRESSURE, Units.PRESSURE_MBAR): SensorEntityDescription(
|
||||||
key=f"{QingpingSensorDeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
key=f"{QingpingSensorDeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|
|
@ -21,9 +21,9 @@ from homeassistant.components.sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_MBAR,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -47,7 +47,7 @@ SENSOR_DESCRIPTIONS = {
|
||||||
(DeviceClass.PRESSURE, Units.PRESSURE_MBAR): SensorEntityDescription(
|
(DeviceClass.PRESSURE, Units.PRESSURE_MBAR): SensorEntityDescription(
|
||||||
key=f"{DeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
key=f"{DeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|
|
@ -13,7 +13,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PERCENTAGE, PRESSURE_HPA, UnitOfLength, UnitOfVolume
|
from homeassistant.const import PERCENTAGE, UnitOfLength, UnitOfPressure, UnitOfVolume
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -84,28 +84,28 @@ API_GEN_2_SENSORS = [
|
||||||
key=sc.TIRE_PRESSURE_FL,
|
key=sc.TIRE_PRESSURE_FL,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name="Tire pressure FL",
|
name="Tire pressure FL",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=sc.TIRE_PRESSURE_FR,
|
key=sc.TIRE_PRESSURE_FR,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name="Tire pressure FR",
|
name="Tire pressure FR",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=sc.TIRE_PRESSURE_RL,
|
key=sc.TIRE_PRESSURE_RL,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name="Tire pressure RL",
|
name="Tire pressure RL",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=sc.TIRE_PRESSURE_RR,
|
key=sc.TIRE_PRESSURE_RR,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
name="Tire pressure RR",
|
name="Tire pressure RR",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -21,7 +21,6 @@ from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS,
|
SIGNAL_STRENGTH_DECIBELS,
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
SPEED_KILOMETERS_PER_HOUR,
|
SPEED_KILOMETERS_PER_HOUR,
|
||||||
|
@ -38,6 +37,7 @@ from homeassistant.const import (
|
||||||
UnitOfLength,
|
UnitOfLength,
|
||||||
UnitOfMass,
|
UnitOfMass,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
@ -222,7 +222,7 @@ SENSOR_UNIT_MAP = {
|
||||||
hc.MASS_KILOGRAMS: UnitOfMass.KILOGRAMS,
|
hc.MASS_KILOGRAMS: UnitOfMass.KILOGRAMS,
|
||||||
hc.PERCENTAGE: PERCENTAGE,
|
hc.PERCENTAGE: PERCENTAGE,
|
||||||
hc.POWER_WATT: UnitOfPower.WATT,
|
hc.POWER_WATT: UnitOfPower.WATT,
|
||||||
hc.PRESSURE_HPA: PRESSURE_HPA,
|
hc.PRESSURE_HPA: UnitOfPressure.HPA,
|
||||||
hc.SIGNAL_STRENGTH_DECIBELS: SIGNAL_STRENGTH_DECIBELS,
|
hc.SIGNAL_STRENGTH_DECIBELS: SIGNAL_STRENGTH_DECIBELS,
|
||||||
hc.SIGNAL_STRENGTH_DECIBELS_MILLIWATT: SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
hc.SIGNAL_STRENGTH_DECIBELS_MILLIWATT: SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
hc.SPEED_KILOMETERS_PER_HOUR: SPEED_KILOMETERS_PER_HOUR,
|
hc.SPEED_KILOMETERS_PER_HOUR: SPEED_KILOMETERS_PER_HOUR,
|
||||||
|
|
|
@ -5,7 +5,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import DEGREE, PRESSURE_MBAR, TEMP_CELSIUS
|
from homeassistant.const import DEGREE, TEMP_CELSIUS, UnitOfPressure
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -32,7 +32,7 @@ UOM_TO_DEVICE_CLASS_MAP = {
|
||||||
UOM_MAP = {
|
UOM_MAP = {
|
||||||
WIFFI_UOM_DEGREE: DEGREE,
|
WIFFI_UOM_DEGREE: DEGREE,
|
||||||
WIFFI_UOM_TEMP_CELSIUS: TEMP_CELSIUS,
|
WIFFI_UOM_TEMP_CELSIUS: TEMP_CELSIUS,
|
||||||
WIFFI_UOM_MILLI_BAR: PRESSURE_MBAR,
|
WIFFI_UOM_MILLI_BAR: UnitOfPressure.MBAR,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ from wolf_smartset.models import (
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PRESSURE_BAR, TEMP_CELSIUS, TIME_HOURS
|
from homeassistant.const import TEMP_CELSIUS, TIME_HOURS, UnitOfPressure
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
@ -128,7 +128,7 @@ class WolfLinkPressure(WolfLinkSensor):
|
||||||
@property
|
@property
|
||||||
def native_unit_of_measurement(self):
|
def native_unit_of_measurement(self):
|
||||||
"""Return the unit the value is expressed in."""
|
"""Return the unit the value is expressed in."""
|
||||||
return PRESSURE_BAR
|
return UnitOfPressure.BAR
|
||||||
|
|
||||||
|
|
||||||
class WolfLinkPercentage(WolfLinkSensor):
|
class WolfLinkPercentage(WolfLinkSensor):
|
||||||
|
|
|
@ -14,9 +14,9 @@ from homeassistant.const import (
|
||||||
ATTR_BATTERY_LEVEL,
|
ATTR_BATTERY_LEVEL,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -53,7 +53,7 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
"pressure": SensorEntityDescription(
|
"pressure": SensorEntityDescription(
|
||||||
key="pressure",
|
key="pressure",
|
||||||
native_unit_of_measurement=PRESSURE_HPA,
|
native_unit_of_measurement=UnitOfPressure.HPA,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
|
|
@ -23,10 +23,10 @@ from homeassistant.const import (
|
||||||
CONDUCTIVITY,
|
CONDUCTIVITY,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_MBAR,
|
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
@ -79,7 +79,7 @@ SENSOR_DESCRIPTIONS = {
|
||||||
(DeviceClass.PRESSURE, Units.PRESSURE_MBAR): SensorEntityDescription(
|
(DeviceClass.PRESSURE, Units.PRESSURE_MBAR): SensorEntityDescription(
|
||||||
key=f"{DeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
key=f"{DeviceClass.PRESSURE}_{Units.PRESSURE_MBAR}",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_MBAR,
|
native_unit_of_measurement=UnitOfPressure.MBAR,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
|
|
@ -16,12 +16,12 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_KPA,
|
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
UnitOfEnergy,
|
UnitOfEnergy,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
|
UnitOfPressure,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
@ -42,7 +42,7 @@ SENSORS_MAP: dict[str, ZWaveMeSensorEntityDescription] = {
|
||||||
"barometer": ZWaveMeSensorEntityDescription(
|
"barometer": ZWaveMeSensorEntityDescription(
|
||||||
key="barometer",
|
key="barometer",
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
native_unit_of_measurement=PRESSURE_KPA,
|
native_unit_of_measurement=UnitOfPressure.KPA,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
"co": ZWaveMeSensorEntityDescription(
|
"co": ZWaveMeSensorEntityDescription(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue