Add device_info to GIOS integration (#38503)
This commit is contained in:
parent
a91f5b7192
commit
d47900473e
2 changed files with 12 additions and 1 deletions
|
@ -10,7 +10,7 @@ from homeassistant.components.air_quality import (
|
|||
)
|
||||
from homeassistant.const import CONF_NAME
|
||||
|
||||
from .const import ATTR_STATION, DOMAIN, ICONS_MAP
|
||||
from .const import ATTR_STATION, DEFAULT_NAME, DOMAIN, ICONS_MAP, MANUFACTURER
|
||||
|
||||
ATTRIBUTION = "Data provided by GIOŚ"
|
||||
|
||||
|
@ -117,6 +117,16 @@ class GiosAirQuality(AirQualityEntity):
|
|||
"""Return a unique_id for this entity."""
|
||||
return self.coordinator.gios.station_id
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return the device info."""
|
||||
return {
|
||||
"identifiers": {(DOMAIN, self.coordinator.gios.station_id)},
|
||||
"name": DEFAULT_NAME,
|
||||
"manufacturer": MANUFACTURER,
|
||||
"entry_type": "service",
|
||||
}
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Return the polling requirement of the entity."""
|
||||
|
|
|
@ -8,6 +8,7 @@ DEFAULT_NAME = "GIOŚ"
|
|||
# Term of service GIOŚ allow downloading data no more than twice an hour.
|
||||
SCAN_INTERVAL = timedelta(minutes=30)
|
||||
DOMAIN = "gios"
|
||||
MANUFACTURER = "Główny Inspektorat Ochrony Środowiska"
|
||||
|
||||
AQI_GOOD = "dobry"
|
||||
AQI_MODERATE = "umiarkowany"
|
||||
|
|
Loading…
Add table
Reference in a new issue