Skip to content

Commit

Permalink
Merge pull request #7 from PTST/4-add-statistics-support
Browse files Browse the repository at this point in the history
  • Loading branch information
PTST authored Feb 22, 2024
2 parents 7a1e34d + 9781cd8 commit cddd075
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/libreview/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async def async_setup_entry(

class GlucoseSensor(CoordinatorEntity, SensorEntity):
_attr_native_unit_of_measurement: str
_attr_state_class = "measurement"
uom: GlucoseUnitOfMeasurement

def __init__(
Expand All @@ -43,6 +44,11 @@ def __init__(
self.uom = uom
self._attr_native_unit_of_measurement = self.uom.value

@property
def icon(self):
# trend icons?
return "mdi:diabetes"

@property
def connection(self) -> Connection:
return self.coordinator.data["glucose_readings"][self.connection_id]
Expand Down

0 comments on commit cddd075

Please sign in to comment.