Add device information to solarlog integration (#43680)

* Update sensor.py

* Changed as requested

Thanks, tested and works ok.

Co-authored-by: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
pull/43781/head
Ernst Klamer 2020-11-30 16:40:43 +01:00 committed by GitHub
parent 3e24868a9e
commit 14d1466400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -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()