Migrate integrations d-e to extend SensorEntity (#48211)
This commit is contained in:
parent
e0cd7072d6
commit
23b562386f
45 changed files with 100 additions and 115 deletions
|
@ -1,4 +1,5 @@
|
|||
"""Support for Dexcom sensors."""
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.const import CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
|
@ -16,7 +17,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
async_add_entities(sensors, False)
|
||||
|
||||
|
||||
class DexcomGlucoseValueSensor(CoordinatorEntity):
|
||||
class DexcomGlucoseValueSensor(SensorEntity, CoordinatorEntity):
|
||||
"""Representation of a Dexcom glucose value sensor."""
|
||||
|
||||
def __init__(self, coordinator, username, unit_of_measurement):
|
||||
|
@ -58,7 +59,7 @@ class DexcomGlucoseValueSensor(CoordinatorEntity):
|
|||
return self._unique_id
|
||||
|
||||
|
||||
class DexcomGlucoseTrendSensor(CoordinatorEntity):
|
||||
class DexcomGlucoseTrendSensor(SensorEntity, CoordinatorEntity):
|
||||
"""Representation of a Dexcom glucose trend sensor."""
|
||||
|
||||
def __init__(self, coordinator, username):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue