Skip to content

Commit

Permalink
Add icon translations to GPSd (#108602)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieger committed Feb 1, 2024
1 parent a075acc commit 421e276
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
13 changes: 13 additions & 0 deletions homeassistant/components/gpsd/icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"entity": {
"sensor": {
"mode": {
"default": "mdi:crosshairs",
"state": {
"2d_fix": "mdi:crosshairs-gps",
"3d_fix": "mdi:crosshairs-gps"
}
}
}
}
}
9 changes: 0 additions & 9 deletions homeassistant/components/gpsd/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 421e276

Please sign in to comment.