Use SensorDeviceClass.VOLUME in components (#79253)
This commit is contained in:
parent
0e764b57c2
commit
fab3ee90b2
8 changed files with 23 additions and 2 deletions
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.const import VOLUME_GALLONS
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -80,6 +80,8 @@ class StreamlabsUsageData:
|
|||
class StreamLabsDailyUsage(SensorEntity):
|
||||
"""Monitors the daily water usage."""
|
||||
|
||||
_attr_device_class = SensorDeviceClass.VOLUME
|
||||
|
||||
def __init__(self, location_name, streamlabs_usage_data):
|
||||
"""Initialize the daily water usage device."""
|
||||
self._location_name = location_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue