From 41ebfcdc9e01384f82bba7580ba7ee7bc3777404 Mon Sep 17 00:00:00 2001 From: Oncleben31 Date: Fri, 1 Jan 2021 01:51:03 +0100 Subject: [PATCH] =?UTF-8?q?Add=20device=20info=20to=20M=C3=A9t=C3=A9o-Fran?= =?UTF-8?q?ce=20(#44457)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homeassistant/components/meteo_france/const.py | 2 ++ homeassistant/components/meteo_france/sensor.py | 13 +++++++++++++ homeassistant/components/meteo_france/weather.py | 13 +++++++++++++ 3 files changed, 28 insertions(+) diff --git a/homeassistant/components/meteo_france/const.py b/homeassistant/components/meteo_france/const.py index d642d3c6e0f..a2e9eeb2799 100644 --- a/homeassistant/components/meteo_france/const.py +++ b/homeassistant/components/meteo_france/const.py @@ -36,6 +36,8 @@ COORDINATOR_RAIN = "coordinator_rain" COORDINATOR_ALERT = "coordinator_alert" UNDO_UPDATE_LISTENER = "undo_update_listener" ATTRIBUTION = "Data provided by Météo-France" +MODEL = "Météo-France mobile API" +MANUFACTURER = "Météo-France" CONF_CITY = "city" FORECAST_MODE_HOURLY = "hourly" diff --git a/homeassistant/components/meteo_france/sensor.py b/homeassistant/components/meteo_france/sensor.py index 8e6b036202f..201cca7ae9d 100644 --- a/homeassistant/components/meteo_france/sensor.py +++ b/homeassistant/components/meteo_france/sensor.py @@ -29,6 +29,8 @@ from .const import ( ENTITY_ICON, ENTITY_NAME, ENTITY_UNIT, + MANUFACTURER, + MODEL, SENSOR_TYPES, ) @@ -94,6 +96,17 @@ class MeteoFranceSensor(CoordinatorEntity): """Return the name.""" return self._name + @property + def device_info(self): + """Return the device info.""" + return { + "identifiers": {(DOMAIN, self.platform.config_entry.unique_id)}, + "name": self.coordinator.name, + "manufacturer": MANUFACTURER, + "model": MODEL, + "entry_type": "service", + } + @property def state(self): """Return the state.""" diff --git a/homeassistant/components/meteo_france/weather.py b/homeassistant/components/meteo_france/weather.py index ffb468574b8..09e062cc715 100644 --- a/homeassistant/components/meteo_france/weather.py +++ b/homeassistant/components/meteo_france/weather.py @@ -28,6 +28,8 @@ from .const import ( DOMAIN, FORECAST_MODE_DAILY, FORECAST_MODE_HOURLY, + MANUFACTURER, + MODEL, ) _LOGGER = logging.getLogger(__name__) @@ -83,6 +85,17 @@ class MeteoFranceWeather(CoordinatorEntity, WeatherEntity): """Return the name of the sensor.""" return self._city_name + @property + def device_info(self): + """Return the device info.""" + return { + "identifiers": {(DOMAIN, self.platform.config_entry.unique_id)}, + "name": self.coordinator.name, + "manufacturer": MANUFACTURER, + "model": MODEL, + "entry_type": "service", + } + @property def condition(self): """Return the current condition."""