+
Skip to content
Draft
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
11 changes: 11 additions & 0 deletions homeassistant/components/tuya/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
EntityCategory,
UnitOfElectricCurrent,
Expand Down Expand Up @@ -107,6 +110,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM25_VALUE,
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
Expand Down Expand Up @@ -278,6 +282,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM25_VALUE,
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
),
Expand All @@ -300,6 +305,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM25_VALUE,
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
Expand Down Expand Up @@ -451,6 +457,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM25_VALUE,
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
Expand Down Expand Up @@ -486,12 +493,14 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM1,
translation_key="pm1",
device_class=SensorDeviceClass.PM1,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM10,
translation_key="pm10",
device_class=SensorDeviceClass.PM10,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
*BATTERY_SENSORS,
Expand Down Expand Up @@ -576,6 +585,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM25_VALUE,
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
Expand Down Expand Up @@ -961,6 +971,7 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
key=DPCode.PM25,
translation_key="pm25",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:molecule",
),
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载