Add device configuration URL to Plugwise (#57696)

This commit is contained in:
Franck Nijhof 2021-10-14 22:31:23 +02:00 committed by GitHub
parent a584d7b5c9
commit 5382ab8562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,11 +192,14 @@ class SmileGateway(CoordinatorEntity):
@property @property
def device_info(self) -> DeviceInfo: def device_info(self) -> DeviceInfo:
"""Return the device information.""" """Return the device information."""
device_information = { device_information = DeviceInfo(
"identifiers": {(DOMAIN, self._dev_id)}, identifiers={(DOMAIN, self._dev_id)},
"name": self._entity_name, name=self._entity_name,
"manufacturer": "Plugwise", manufacturer="Plugwise",
} )
if entry := self.coordinator.config_entry:
device_information["configuration_url"] = f"http://{entry.data[CONF_HOST]}"
if self._model is not None: if self._model is not None:
device_information["model"] = self._model.replace("_", " ").title() device_information["model"] = self._model.replace("_", " ").title()