mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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>
This commit is contained in:
parent
3e24868a9e
commit
14d1466400
@ -9,7 +9,7 @@ from homeassistant.const import CONF_HOST
|
|||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
from .const import SCAN_INTERVAL, SENSOR_TYPES
|
from .const import DOMAIN, SCAN_INTERVAL, SENSOR_TYPES
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -96,6 +96,15 @@ class SolarlogSensor(Entity):
|
|||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return self._state
|
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):
|
def update(self):
|
||||||
"""Get the latest data from the sensor and update the state."""
|
"""Get the latest data from the sensor and update the state."""
|
||||||
self.data.update()
|
self.data.update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user