Skip to content

Commit

Permalink
Add units to smoke sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneofghosts authored Apr 28, 2024
1 parent 9bb315c commit 74940c0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions custom_components/pirateweather/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

from homeassistant.const import (
ATTR_ATTRIBUTION,
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
Expand Down Expand Up @@ -392,6 +393,11 @@ class PirateWeatherSensorEntityDescription(SensorEntityDescription):
key="smoke",
name="Smoke",
state_class=SensorDeviceClass.PM25,
si_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
us_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
ca_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
uk_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
uk2_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
suggested_display_precision=2,
icon="mdi:smoke",
forecast_mode=["currently", "hourly"],
Expand All @@ -400,6 +406,11 @@ class PirateWeatherSensorEntityDescription(SensorEntityDescription):
key="smoke_max",
name="Smoke Max",
state_class=SensorDeviceClass.PM25,
si_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
us_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
ca_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
uk_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
uk2_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
suggested_display_precision=2,
icon="mdi:smoke",
forecast_mode=["daily"],
Expand Down

0 comments on commit 74940c0

Please sign in to comment.