Skip to content

Commit

Permalink
Update sensor state class and sensor device class.
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanvanzyl committed Mar 9, 2023
1 parent ed9717f commit 8baa6c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.components.weather import ATTR_FORECAST
from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN
Expand Down Expand Up @@ -110,7 +110,8 @@ class ClothingSensor(SensorEntity):
"""Representation of a Clothing Sensor."""

_attr_icon = "mdi:tshirt-crew"
_attr_state_class = SensorStateClass.MEASUREMENT
_attr_state_class = None
_attr_device_class = SensorDeviceClass.ENUM
_clothing: str = STATE_UNKNOWN
_confidence: float = 0
_n: int = 0
Expand All @@ -126,6 +127,7 @@ def __init__(
self._hours = hours
self._conditions = conditions
self._attr_unique_id = unique_id
self._attr_options = [item for item in conditions]

def predict(self, forecast: list[dict[str, Any]]) -> None:
"""Predict the appropriate clothing based on the forecast."""
Expand Down

0 comments on commit 8baa6c0

Please sign in to comment.