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

Tuya air quality fix #1

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
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 @@ -13,7 +13,10 @@
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (

Check failure on line 16 in homeassistant/components/tuya/sensor.py

View workflow job for this annotation

GitHub Actions / Check pylint

E0611: No name 'ELECTRIC_CURRENT_AMPERE' in module 'homeassistant.const' (no-name-in-module)

Check failure on line 16 in homeassistant/components/tuya/sensor.py

View workflow job for this annotation

GitHub Actions / Check pylint

E0611: No name 'ELECTRIC_POTENTIAL_VOLT' in module 'homeassistant.const' (no-name-in-module)

Check warning on line 16 in homeassistant/components/tuya/sensor.py

View workflow job for this annotation

GitHub Actions / Check pylint

W7422: ELECTRIC_CURRENT_AMPERE is deprecated, replaced by unit enums (hass-deprecated-import)

Check warning on line 16 in homeassistant/components/tuya/sensor.py

View workflow job for this annotation

GitHub Actions / Check pylint

W7422: ELECTRIC_POTENTIAL_VOLT is deprecated, replaced by unit enums (hass-deprecated-import)

Check warning on line 16 in homeassistant/components/tuya/sensor.py

View workflow job for this annotation

GitHub Actions / Check pylint

W7422: ELECTRIC_CURRENT_AMPERE is deprecated, replaced by unit enums (hass-deprecated-import)

Check warning on line 16 in homeassistant/components/tuya/sensor.py

View workflow job for this annotation

GitHub Actions / Check pylint

W7422: ELECTRIC_POTENTIAL_VOLT is deprecated, replaced by unit enums (hass-deprecated-import)
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
EntityCategory,
UnitOfElectricCurrent,
Expand Down Expand Up @@ -107,6 +110,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
Loading