From abd69fb165d48b1c228b3586e1d09bd7ddcccd58 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Tue, 28 Jul 2026 14:40:10 +0800 Subject: [PATCH] Readd missed platforms to demo (#177432) --- homeassistant/components/demo/__init__.py | 2 + homeassistant/components/demo/geo_location.py | 45 +++++++++++-------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/homeassistant/components/demo/__init__.py b/homeassistant/components/demo/__init__.py index 64ac2bb6afe8..9bdc111df88f 100644 --- a/homeassistant/components/demo/__init__.py +++ b/homeassistant/components/demo/__init__.py @@ -37,6 +37,7 @@ COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM = [ Platform.MEDIA_PLAYER, Platform.NOTIFY, Platform.NUMBER, + Platform.REMOTE, Platform.SELECT, Platform.SENSOR, Platform.SIREN, @@ -52,6 +53,7 @@ COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM = [ ] COMPONENTS_WITH_DEMO_PLATFORM = [ + Platform.GEO_LOCATION, Platform.TTS, Platform.IMAGE_PROCESSING, Platform.DEVICE_TRACKER, diff --git a/homeassistant/components/demo/geo_location.py b/homeassistant/components/demo/geo_location.py index db8206a6746c..a8760308adec 100644 --- a/homeassistant/components/demo/geo_location.py +++ b/homeassistant/components/demo/geo_location.py @@ -18,24 +18,24 @@ _LOGGER = logging.getLogger(__name__) AVG_KM_PER_DEGREE = 111.0 DEFAULT_UPDATE_INTERVAL = timedelta(minutes=1) MAX_RADIUS_IN_KM = 50 -NUMBER_OF_DEMO_DEVICES = 5 +NUMBER_OF_DEMO_DEVICES = 2 -EVENT_NAMES = [ - "Bushfire", - "Hazard Reduction", - "Grass Fire", - "Burn off", - "Structure Fire", - "Fire Alarm", - "Thunderstorm", - "Tornado", - "Cyclone", - "Waterspout", - "Dust Storm", - "Blizzard", - "Ice Storm", - "Earthquake", - "Tsunami", +EVENTS = [ + {"name": "Bushfire", "icon": "mdi:fire"}, + {"name": "Hazard Reduction", "icon": "mdi:alarm-light"}, + {"name": "Grass Fire", "icon": "mdi:fire"}, + {"name": "Burn off", "icon": "mdi:fire"}, + {"name": "Structure Fire", "icon": "mdi:wall-fire"}, + {"name": "Fire Alarm", "icon": "mdi:fire-truck"}, + {"name": "Thunderstorm", "icon": "mdi:weather-lightning-rainy"}, + {"name": "Tornado", "icon": "mdi:weather-tornado"}, + {"name": "Cyclone", "icon": "mdi:weather-tornado"}, + {"name": "Waterspout", "icon": "mdi:weather-tornado"}, + {"name": "Dust Storm", "icon": "mdi:weather-dust"}, + {"name": "Blizzard", "icon": "mdi:weather-snowy-heavy"}, + {"name": "Ice Storm", "icon": "mdi:snowflake-alert"}, + {"name": "Earthquake", "icon": "mdi:earth"}, + {"name": "Tsunami", "icon": "mdi:waves-arrow-right"}, ] SOURCE = "demo" @@ -78,9 +78,14 @@ class DemoManager: radians(home_latitude) ) - event_name = random.choice(EVENT_NAMES) + event = random.choice(EVENTS) return DemoGeolocationEvent( - event_name, radius_in_km, latitude, longitude, UnitOfLength.KILOMETERS + event["name"], + event["icon"], + radius_in_km, + latitude, + longitude, + UnitOfLength.KILOMETERS, ) def _init_regular_updates(self) -> None: @@ -120,6 +125,7 @@ class DemoGeolocationEvent(GeolocationEvent): def __init__( self, name: str, + icon: str, distance: float, latitude: float, longitude: float, @@ -131,6 +137,7 @@ class DemoGeolocationEvent(GeolocationEvent): self._latitude = latitude self._longitude = longitude self._unit_of_measurement = unit_of_measurement + self._attr_icon = icon @property @override