mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add device info to Météo-France (#44457)
This commit is contained in:
parent
12b7b2098d
commit
41ebfcdc9e
@ -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"
|
||||
|
@ -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."""
|
||||
|
@ -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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user