diff --git a/homeassistant/components/tomorrowio/sensor.py b/homeassistant/components/tomorrowio/sensor.py index a174d983131..260ce7390eb 100644 --- a/homeassistant/components/tomorrowio/sensor.py +++ b/homeassistant/components/tomorrowio/sensor.py @@ -169,7 +169,9 @@ SENSOR_TYPES = ( key=TMRW_ATTR_PRECIPITATION_TYPE, name="Precipitation Type", value_map=PrecipitationType, - device_class="tomorrowio__precipitation_type", + device_class=SensorDeviceClass.ENUM, + options=["freezing_rain", "ice_pellets", "none", "rain", "snow"], + translation_key="precipitation_type", icon="mdi:weather-snowy-rainy", ), # Data comes in as ppb, convert to µg/m^3 @@ -233,7 +235,16 @@ SENSOR_TYPES = ( key=TMRW_ATTR_EPA_HEALTH_CONCERN, name="US EPA Health Concern", value_map=HealthConcernType, - device_class="tomorrowio__health_concern", + device_class=SensorDeviceClass.ENUM, + options=[ + "good", + "hazardous", + "moderate", + "unhealthy_for_sensitive_groups", + "unhealthy", + "very_unhealthy", + ], + translation_key="health_concern", icon="mdi:hospital", ), TomorrowioSensorEntityDescription( @@ -250,28 +261,43 @@ SENSOR_TYPES = ( key=TMRW_ATTR_CHINA_HEALTH_CONCERN, name="China MEP Health Concern", value_map=HealthConcernType, - device_class="tomorrowio__health_concern", + device_class=SensorDeviceClass.ENUM, + options=[ + "good", + "hazardous", + "moderate", + "unhealthy_for_sensitive_groups", + "unhealthy", + "very_unhealthy", + ], + translation_key="health_concern", icon="mdi:hospital", ), TomorrowioSensorEntityDescription( key=TMRW_ATTR_POLLEN_TREE, name="Tree Pollen Index", value_map=PollenIndex, - device_class="tomorrowio__pollen_index", + device_class=SensorDeviceClass.ENUM, + options=["high", "low", "medium", "none", "very_high", "very_low"], + translation_key="pollen_index", icon="mdi:flower-pollen", ), TomorrowioSensorEntityDescription( key=TMRW_ATTR_POLLEN_WEED, name="Weed Pollen Index", value_map=PollenIndex, - device_class="tomorrowio__pollen_index", + device_class=SensorDeviceClass.ENUM, + options=["high", "low", "medium", "none", "very_high", "very_low"], + translation_key="pollen_index", icon="mdi:flower-pollen", ), TomorrowioSensorEntityDescription( key=TMRW_ATTR_POLLEN_GRASS, name="Grass Pollen Index", value_map=PollenIndex, - device_class="tomorrowio__pollen_index", + device_class=SensorDeviceClass.ENUM, + options=["high", "low", "medium", "none", "very_high", "very_low"], + translation_key="pollen_index", icon="mdi:flower-pollen", ), TomorrowioSensorEntityDescription( diff --git a/homeassistant/components/tomorrowio/strings.json b/homeassistant/components/tomorrowio/strings.json index 30b729e6ef1..3ae70f214bb 100644 --- a/homeassistant/components/tomorrowio/strings.json +++ b/homeassistant/components/tomorrowio/strings.json @@ -27,5 +27,38 @@ } } } + }, + "entity": { + "sensor": { + "health_concern": { + "state": { + "good": "Good", + "moderate": "Moderate", + "unhealthy_for_sensitive_groups": "Unhealthy for Sensitive Groups", + "unhealthy": "Unhealthy", + "very_unhealthy": "Very Unhealthy", + "hazardous": "Hazardous" + } + }, + "pollen_index": { + "state": { + "none": "None", + "very_low": "Very Low", + "low": "Low", + "medium": "Medium", + "high": "High", + "very_high": "Very High" + } + }, + "precipitation_type": { + "state": { + "none": "None", + "rain": "Rain", + "snow": "Snow", + "freezing_rain": "Freezing Rain", + "ice_pellets": "Ice Pellets" + } + } + } } } diff --git a/homeassistant/components/tomorrowio/strings.sensor.json b/homeassistant/components/tomorrowio/strings.sensor.json deleted file mode 100644 index a1ee6d1b744..00000000000 --- a/homeassistant/components/tomorrowio/strings.sensor.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "state": { - "tomorrowio__pollen_index": { - "none": "None", - "very_low": "Very Low", - "low": "Low", - "medium": "Medium", - "high": "High", - "very_high": "Very High" - }, - "tomorrowio__health_concern": { - "good": "Good", - "moderate": "Moderate", - "unhealthy_for_sensitive_groups": "Unhealthy for Sensitive Groups", - "unhealthy": "Unhealthy", - "very_unhealthy": "Very Unhealthy", - "hazardous": "Hazardous" - }, - "tomorrowio__precipitation_type": { - "none": "None", - "rain": "Rain", - "snow": "Snow", - "freezing_rain": "Freezing Rain", - "ice_pellets": "Ice Pellets" - } - } -} diff --git a/homeassistant/components/tomorrowio/translations/en.json b/homeassistant/components/tomorrowio/translations/en.json index f3706dd6a73..15d1aadeaaf 100644 --- a/homeassistant/components/tomorrowio/translations/en.json +++ b/homeassistant/components/tomorrowio/translations/en.json @@ -17,6 +17,39 @@ } } }, + "entity": { + "sensor": { + "health_concern": { + "state": { + "good": "Good", + "hazardous": "Hazardous", + "moderate": "Moderate", + "unhealthy": "Unhealthy", + "unhealthy_for_sensitive_groups": "Unhealthy for Sensitive Groups", + "very_unhealthy": "Very Unhealthy" + } + }, + "pollen_index": { + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "none": "None", + "very_high": "Very High", + "very_low": "Very Low" + } + }, + "precipitation_type": { + "state": { + "freezing_rain": "Freezing Rain", + "ice_pellets": "Ice Pellets", + "none": "None", + "rain": "Rain", + "snow": "Snow" + } + } + } + }, "options": { "step": { "init": {