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

Fixes environmental data reporting (#17) #18

Merged
merged 1 commit into from
May 5, 2023
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
19 changes: 9 additions & 10 deletions custom_components/dyson_local/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,9 @@ def native_value(self) -> int:

class DysonParticulatesSensor(DysonSensorEnvironmental):
"""Dyson sensor for particulate matters for "Link" devices."""

_SENSOR_TYPE = "pm1"
_SENSOR_NAME = "Air Quality"
_attr_device_class = SensorDeviceClass.PM1
_SENSOR_TYPE = "aqi"
_SENSOR_NAME = "Air Quality Index"
_attr_device_class = SensorDeviceClass.AQI
_attr_state_class = SensorStateClass.MEASUREMENT

@environmental_property
Expand All @@ -296,9 +295,9 @@ def native_value(self) -> int:
class DysonVOCSensor(DysonSensorEnvironmental):
"""Dyson sensor for volatile organic compounds."""

_SENSOR_TYPE = "voc"
_SENSOR_NAME = "Volatile Organic Compounds"
_attr_device_class = SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS
_SENSOR_TYPE = "voc-index"
_SENSOR_NAME = "Volatile Organic Compounds Index"
_attr_device_class = SensorDeviceClass.AQI
_attr_state_class = SensorStateClass.MEASUREMENT

@environmental_property
Expand All @@ -310,9 +309,9 @@ def native_value(self) -> float:
class DysonNO2Sensor(DysonSensorEnvironmental):
"""Dyson sensor for Nitrogen Dioxide."""

_SENSOR_TYPE = "no2"
_SENSOR_NAME = "Nitrogen Dioxide"
_attr_device_class = SensorDeviceClass.NITROGEN_DIOXIDE
_SENSOR_TYPE = "no2-index"
_SENSOR_NAME = "Nitrogen Dioxide Index"
_attr_device_class = SensorDeviceClass.AQI
_attr_state_class = SensorStateClass.MEASUREMENT

@environmental_property
Expand Down