Skip to content

Commit

Permalink
Fix SensorStateClass import
Browse files Browse the repository at this point in the history
  • Loading branch information
sebr committed Sep 2, 2024
1 parent 965200a commit 632ebc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/bhyve/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from datetime import timedelta
import logging

from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_BATTERY_LEVEL, SensorStateClass, UnitOfTemperature
from homeassistant.const import ATTR_BATTERY_LEVEL, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand Down Expand Up @@ -173,7 +173,7 @@ def parse_battery_level(battery_data):
Otherwise, if the 'mv' attribute is present, the battery level is calculated as a percentage
based on the millivolts, assuming that 2x1.5V AA batteries are used. Note that AA batteries can
range from 1.2V to 1.7V depending on their chemistry, so the calculation may not be accurate
for all types of batteries. YMMV ¯\_(ツ)_/¯
for all types of batteries. YMMV
Args:
battery_data (dict): A dictionary containing the battery data.
Expand Down

0 comments on commit 632ebc7

Please sign in to comment.