Add configuration_url to gogogate2 (#57739)

This commit is contained in:
J. Nick Koston 2021-10-14 17:51:12 -10:00 committed by GitHub
parent 148d2480ac
commit e7ac734d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ from homeassistant.const import (
) )
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.debounce import Debouncer from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.httpx_client import get_async_client from homeassistant.helpers.httpx_client import get_async_client
from homeassistant.helpers.update_coordinator import ( from homeassistant.helpers.update_coordinator import (
CoordinatorEntity, CoordinatorEntity,
@ -95,13 +96,18 @@ class GoGoGate2Entity(CoordinatorEntity):
def device_info(self): def device_info(self):
"""Device info for the controller.""" """Device info for the controller."""
data = self.coordinator.data data = self.coordinator.data
return { info: DeviceInfo = {
"identifiers": {(DOMAIN, self._config_entry.unique_id)}, "identifiers": {(DOMAIN, self._config_entry.unique_id)},
"name": self._config_entry.title, "name": self._config_entry.title,
"manufacturer": MANUFACTURER, "manufacturer": MANUFACTURER,
"model": data.model, "model": data.model,
"sw_version": data.firmwareversion, "sw_version": data.firmwareversion,
} }
if data.model.startswith("ismartgate"):
info[
"configuration_url"
] = f"https://{self._config_entry.unique_id}.isgaccess.com"
return info
def get_data_update_coordinator( def get_data_update_coordinator(