Create devices for Growatt (#57068)
parent
8de7966104
commit
325d5e1c22
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue