From 5382ab8562cb3696e4240d5fbd9e650e7ffd225b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 14 Oct 2021 22:31:23 +0200 Subject: [PATCH] Add device configuration URL to Plugwise (#57696) --- homeassistant/components/plugwise/gateway.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/plugwise/gateway.py b/homeassistant/components/plugwise/gateway.py index 41e3caacbff..976accfdfa0 100644 --- a/homeassistant/components/plugwise/gateway.py +++ b/homeassistant/components/plugwise/gateway.py @@ -192,11 +192,14 @@ class SmileGateway(CoordinatorEntity): @property def device_info(self) -> DeviceInfo: """Return the device information.""" - device_information = { - "identifiers": {(DOMAIN, self._dev_id)}, - "name": self._entity_name, - "manufacturer": "Plugwise", - } + device_information = DeviceInfo( + identifiers={(DOMAIN, self._dev_id)}, + name=self._entity_name, + manufacturer="Plugwise", + ) + + if entry := self.coordinator.config_entry: + device_information["configuration_url"] = f"http://{entry.data[CONF_HOST]}" if self._model is not None: device_information["model"] = self._model.replace("_", " ").title()