diff --git a/CODEOWNERS b/CODEOWNERS index 32c2f5c2930..7f60243097e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -191,6 +191,7 @@ homeassistant/components/no_ip/* @fabaff homeassistant/components/notify/* @home-assistant/core homeassistant/components/notion/* @bachya homeassistant/components/nsw_fuel_station/* @nickw444 +homeassistant/components/nsw_rural_fire_service_feed/* @exxamalte homeassistant/components/nuki/* @pschmitt homeassistant/components/nws/* @MatthewFlamm homeassistant/components/ohmconnect/* @robbiet480 diff --git a/homeassistant/components/nsw_rural_fire_service_feed/geo_location.py b/homeassistant/components/nsw_rural_fire_service_feed/geo_location.py index 16ef2c10bbd..9a9679f9575 100644 --- a/homeassistant/components/nsw_rural_fire_service_feed/geo_location.py +++ b/homeassistant/components/nsw_rural_fire_service_feed/geo_location.py @@ -210,6 +210,13 @@ class NswRuralFireServiceLocationEvent(GeolocationEvent): self._size = feed_entry.size self._responsible_agency = feed_entry.responsible_agency + @property + def icon(self): + """Return the icon to use in the frontend.""" + if self._fire: + return "mdi:fire" + return "mdi:alarm-light" + @property def source(self) -> str: """Return source value of this external event.""" diff --git a/homeassistant/components/nsw_rural_fire_service_feed/manifest.json b/homeassistant/components/nsw_rural_fire_service_feed/manifest.json index b2bc6aaab24..4542eb45c82 100644 --- a/homeassistant/components/nsw_rural_fire_service_feed/manifest.json +++ b/homeassistant/components/nsw_rural_fire_service_feed/manifest.json @@ -6,5 +6,7 @@ "geojson_client==0.4" ], "dependencies": [], - "codeowners": [] + "codeowners": [ + "@exxamalte" + ] } diff --git a/tests/components/nsw_rural_fire_service_feed/test_geo_location.py b/tests/components/nsw_rural_fire_service_feed/test_geo_location.py index 8913c0ffa48..f5f88087010 100644 --- a/tests/components/nsw_rural_fire_service_feed/test_geo_location.py +++ b/tests/components/nsw_rural_fire_service_feed/test_geo_location.py @@ -27,6 +27,7 @@ from homeassistant.const import ( CONF_LONGITUDE, CONF_RADIUS, EVENT_HOMEASSISTANT_START, + ATTR_ICON, ) from homeassistant.setup import async_setup_component from tests.common import assert_setup_component, async_fire_time_changed @@ -150,6 +151,7 @@ async def test_setup(hass): ATTR_RESPONSIBLE_AGENCY: "Agency 1", ATTR_UNIT_OF_MEASUREMENT: "km", ATTR_SOURCE: "nsw_rural_fire_service_feed", + ATTR_ICON: "mdi:fire", } assert round(abs(float(state.state) - 15.5), 7) == 0 @@ -164,6 +166,7 @@ async def test_setup(hass): ATTR_FIRE: False, ATTR_UNIT_OF_MEASUREMENT: "km", ATTR_SOURCE: "nsw_rural_fire_service_feed", + ATTR_ICON: "mdi:alarm-light", } assert round(abs(float(state.state) - 20.5), 7) == 0 @@ -178,6 +181,7 @@ async def test_setup(hass): ATTR_FIRE: True, ATTR_UNIT_OF_MEASUREMENT: "km", ATTR_SOURCE: "nsw_rural_fire_service_feed", + ATTR_ICON: "mdi:fire", } assert round(abs(float(state.state) - 25.5), 7) == 0