Code tidyness for Dexcom (#95232)

This commit is contained in:
Joost Lekkerkerker 2023-06-26 18:22:44 +02:00 committed by GitHub
parent f0493b22d4
commit 91e6e918c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,10 +20,13 @@ async def async_setup_entry(
coordinator = hass.data[DOMAIN][config_entry.entry_id][COORDINATOR]
username = config_entry.data[CONF_USERNAME]
unit_of_measurement = config_entry.options[CONF_UNIT_OF_MEASUREMENT]
sensors: list[SensorEntity] = []
sensors.append(DexcomGlucoseTrendSensor(coordinator, username))
sensors.append(DexcomGlucoseValueSensor(coordinator, username, unit_of_measurement))
async_add_entities(sensors, False)
async_add_entities(
[
DexcomGlucoseTrendSensor(coordinator, username),
DexcomGlucoseValueSensor(coordinator, username, unit_of_measurement),
],
False,
)
class DexcomGlucoseValueSensor(CoordinatorEntity, SensorEntity):