Add `configuration_url` to Airly integration (#58911)

pull/58977/head
Maciej Bieniek 2021-11-02 09:39:23 +01:00 committed by Paulus Schoutsen
parent 26e925d885
commit 53cc9f35b9
2 changed files with 5 additions and 0 deletions

View File

@ -32,3 +32,4 @@ MANUFACTURER: Final = "Airly sp. z o.o."
MAX_UPDATE_INTERVAL: Final = 90
MIN_UPDATE_INTERVAL: Final = 5
NO_AIRLY_SENSORS: Final = "There are no Airly sensors in this area yet."
URL = "https://airly.org/map/#{latitude},{longitude}"

View File

@ -55,6 +55,7 @@ from .const import (
MANUFACTURER,
SUFFIX_LIMIT,
SUFFIX_PERCENT,
URL,
)
PARALLEL_UPDATES = 1
@ -157,6 +158,9 @@ class AirlySensor(CoordinatorEntity, SensorEntity):
identifiers={(DOMAIN, f"{coordinator.latitude}-{coordinator.longitude}")},
manufacturer=MANUFACTURER,
name=DEFAULT_NAME,
configuration_url=URL.format(
latitude=coordinator.latitude, longitude=coordinator.longitude
),
)
self._attr_name = f"{name} {description.name}"
self._attr_unique_id = (