Skip to content

Commit

Permalink
Remove "Measurement" state class from battery sensor.
Browse files Browse the repository at this point in the history
Using state_class of SensorStateClass.MEASUREMENT leads to warning from HA about expecting numeric value.  Sonic battery level is only ever returned as string "high, medium, low"

See: #23
  • Loading branch information
markvader authored Jul 27, 2023
1 parent 0e5e885 commit a1f402b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/sonic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class SonicBatterySensor(SonicEntity, SensorEntity):

_attr_icon = BATTERY_ICON
_attr_native_unit_of_measurement = "battery"
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
_attr_state_class: SensorStateClass = SensorStateClass.None

def __init__(self, device):
"""Initialize the battery sensor."""
Expand Down

0 comments on commit a1f402b

Please sign in to comment.