Skip to content

Commit

Permalink
Merge pull request #100 from thoemmi/patch-1
Browse files Browse the repository at this point in the history
Enable statistics for distance sensor
  • Loading branch information
mrk-its authored May 6, 2024
2 parents 96b4d52 + 99b0fe0 commit ddcd634
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/blitzortung/sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, DEGREE, UnitOfLength
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity, SensorStateClass
from homeassistant.helpers.device_registry import DeviceEntryType

from .const import (
Expand Down Expand Up @@ -144,6 +144,7 @@ def tick(self):
class DistanceSensor(LightningSensor):
kind = SensorDeviceClass.DISTANCE
device_class = SensorDeviceClass.DISTANCE
state_class = SensorStateClass.MEASUREMENT
_attr_native_unit_of_measurement = UnitOfLength.KILOMETERS

def update_lightning(self, lightning):
Expand Down

0 comments on commit ddcd634

Please sign in to comment.