From 421e2761858baae9516285ba204b0fcb2c1e27f5 Mon Sep 17 00:00:00 2001 From: Jan Rieger Date: Thu, 1 Feb 2024 08:58:32 +0100 Subject: [PATCH] Add icon translations to GPSd (#108602) --- homeassistant/components/gpsd/icons.json | 13 +++++++++++++ homeassistant/components/gpsd/sensor.py | 9 --------- 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 homeassistant/components/gpsd/icons.json diff --git a/homeassistant/components/gpsd/icons.json b/homeassistant/components/gpsd/icons.json new file mode 100644 index 00000000000000..b29640e0001c88 --- /dev/null +++ b/homeassistant/components/gpsd/icons.json @@ -0,0 +1,13 @@ +{ + "entity": { + "sensor": { + "mode": { + "default": "mdi:crosshairs", + "state": { + "2d_fix": "mdi:crosshairs-gps", + "3d_fix": "mdi:crosshairs-gps" + } + } + } + } +} diff --git a/homeassistant/components/gpsd/sensor.py b/homeassistant/components/gpsd/sensor.py index 932db0815985ed..d5d25397f2a016 100644 --- a/homeassistant/components/gpsd/sensor.py +++ b/homeassistant/components/gpsd/sensor.py @@ -144,12 +144,3 @@ def extra_state_attributes(self) -> dict[str, Any]: ATTR_CLIMB: self.agps_thread.data_stream.climb, ATTR_MODE: self.agps_thread.data_stream.mode, } - - @property - def icon(self) -> str: - """Return the icon of the sensor.""" - mode = self.agps_thread.data_stream.mode - - if isinstance(mode, int) and mode >= 2: - return "mdi:crosshairs-gps" - return "mdi:crosshairs"