From 840d881c25de33f5d5750cb613a81b6101ae205a Mon Sep 17 00:00:00 2001 From: Jan Rieger Date: Thu, 14 Sep 2023 09:27:16 +0200 Subject: [PATCH] Add icon to GPSD (#100347) --- homeassistant/components/gpsd/sensor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/gpsd/sensor.py b/homeassistant/components/gpsd/sensor.py index 3e356f1509c..64b86434c3c 100644 --- a/homeassistant/components/gpsd/sensor.py +++ b/homeassistant/components/gpsd/sensor.py @@ -121,3 +121,12 @@ class GpsdSensor(SensorEntity): 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"