Create devices for Growatt (#57068)

pull/57399/head
indykoning 2021-10-09 20:36:38 +02:00 committed by GitHub
parent 8de7966104
commit 325d5e1c22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -15,6 +15,9 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
)
from homeassistant.const import (
ATTR_IDENTIFIERS,
ATTR_MANUFACTURER,
ATTR_NAME,
CONF_NAME,
CONF_PASSWORD,
CONF_URL,
@ -37,7 +40,13 @@ from homeassistant.const import (
)
from homeassistant.util import Throttle, dt
from .const import CONF_PLANT_ID, DEFAULT_PLANT_ID, DEFAULT_URL, LOGIN_INVALID_AUTH_CODE
from .const import (
CONF_PLANT_ID,
DEFAULT_PLANT_ID,
DEFAULT_URL,
DOMAIN,
LOGIN_INVALID_AUTH_CODE,
)
_LOGGER = logging.getLogger(__name__)
@ -970,6 +979,12 @@ class GrowattInverter(SensorEntity):
self._attr_unique_id = unique_id
self._attr_icon = "mdi:solar-power"
self._attr_device_info = {
ATTR_IDENTIFIERS: {(DOMAIN, probe.device_id)},
ATTR_NAME: name,
ATTR_MANUFACTURER: "Growatt",
}
@property
def native_value(self):
"""Return the state of the sensor."""