From 14d1466400ee37c41b5b57146666913a4feb5254 Mon Sep 17 00:00:00 2001 From: Ernst Klamer Date: Mon, 30 Nov 2020 16:40:43 +0100 Subject: [PATCH] Add device information to solarlog integration (#43680) * Update sensor.py * Changed as requested Thanks, tested and works ok. Co-authored-by: J. Nick Koston Co-authored-by: J. Nick Koston --- homeassistant/components/solarlog/sensor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/solarlog/sensor.py b/homeassistant/components/solarlog/sensor.py index 8c0650f0f7e..6073d12815b 100644 --- a/homeassistant/components/solarlog/sensor.py +++ b/homeassistant/components/solarlog/sensor.py @@ -9,7 +9,7 @@ from homeassistant.const import CONF_HOST from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle -from .const import SCAN_INTERVAL, SENSOR_TYPES +from .const import DOMAIN, SCAN_INTERVAL, SENSOR_TYPES _LOGGER = logging.getLogger(__name__) @@ -96,6 +96,15 @@ class SolarlogSensor(Entity): """Return the state of the sensor.""" return self._state + @property + def device_info(self): + """Return the device information.""" + return { + "identifiers": {(DOMAIN, self.entry_id)}, + "name": self.device_name, + "manufacturer": "Solar-Log", + } + def update(self): """Get the latest data from the sensor and update the state.""" self.data.update()