From 4982e792f361042696fe0510c965c8c67aac356b Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sun, 25 Feb 2024 14:17:08 +0100 Subject: [PATCH] Add icon translations to Dexcom (#111368) --- homeassistant/components/dexcom/const.py | 1 - homeassistant/components/dexcom/icons.json | 9 +++++++++ homeassistant/components/dexcom/sensor.py | 3 +-- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 homeassistant/components/dexcom/icons.json diff --git a/homeassistant/components/dexcom/const.py b/homeassistant/components/dexcom/const.py index cb75f3bd500..8712eeb10ad 100644 --- a/homeassistant/components/dexcom/const.py +++ b/homeassistant/components/dexcom/const.py @@ -3,7 +3,6 @@ from homeassistant.const import Platform DOMAIN = "dexcom" PLATFORMS = [Platform.SENSOR] -GLUCOSE_VALUE_ICON = "mdi:diabetes" GLUCOSE_TREND_ICON = [ "mdi:help", diff --git a/homeassistant/components/dexcom/icons.json b/homeassistant/components/dexcom/icons.json new file mode 100644 index 00000000000..9d0b3534e17 --- /dev/null +++ b/homeassistant/components/dexcom/icons.json @@ -0,0 +1,9 @@ +{ + "entity": { + "sensor": { + "glucose_value": { + "default": "mdi:diabetes" + } + } + } +} diff --git a/homeassistant/components/dexcom/sensor.py b/homeassistant/components/dexcom/sensor.py index 126d946e57d..592419abc1b 100644 --- a/homeassistant/components/dexcom/sensor.py +++ b/homeassistant/components/dexcom/sensor.py @@ -12,7 +12,7 @@ from homeassistant.helpers.update_coordinator import ( DataUpdateCoordinator, ) -from .const import COORDINATOR, DOMAIN, GLUCOSE_TREND_ICON, GLUCOSE_VALUE_ICON, MG_DL +from .const import COORDINATOR, DOMAIN, GLUCOSE_TREND_ICON, MG_DL async def async_setup_entry( @@ -55,7 +55,6 @@ class DexcomSensorEntity(CoordinatorEntity, SensorEntity): class DexcomGlucoseValueSensor(DexcomSensorEntity): """Representation of a Dexcom glucose value sensor.""" - _attr_icon = GLUCOSE_VALUE_ICON _attr_translation_key = "glucose_value" def __init__(