Use updated powerwall client API library (#34139)
* Use updated powerwall client API library * Increase instant_power precision to 3 * Add @jrester as code owner for powerwall
This commit is contained in:
1 parent
7bd6f5413d
commit
6924192523
13 files changed
+104
-117
No files matched your search
@@ -2,17 +2,7 @@
|
||||
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
from .const import (
|
||||
DEVICE_TYPE_DEVICE_TYPE,
|
||||
DOMAIN,
|
||||
MANUFACTURER,
|
||||
MODEL,
|
||||
POWERWALL_SITE_NAME,
|
||||
SITE_INFO_GRID_CODE,
|
||||
SITE_INFO_NOMINAL_SYSTEM_ENERGY_KWH,
|
||||
SITE_INFO_UTILITY,
|
||||
STATUS_VERSION,
|
||||
)
|
||||
from .const import DOMAIN, MANUFACTURER, MODEL
|
||||
|
||||
|
||||
class PowerWallEntity(Entity):
|
||||
@@ -23,13 +13,13 @@ class PowerWallEntity(Entity):
|
||||
super().__init__()
|
||||
self._coordinator = coordinator
|
||||
self._site_info = site_info
|
||||
self._device_type = device_type.get(DEVICE_TYPE_DEVICE_TYPE)
|
||||
self._version = status.get(STATUS_VERSION)
|
||||
self._device_type = device_type
|
||||
self._version = status.version
|
||||
# This group of properties will be unique to to the site
|
||||
unique_group = (
|
||||
site_info[SITE_INFO_UTILITY],
|
||||
site_info[SITE_INFO_GRID_CODE],
|
||||
str(site_info[SITE_INFO_NOMINAL_SYSTEM_ENERGY_KWH]),
|
||||
site_info.utility,
|
||||
site_info.grid_code,
|
||||
str(site_info.nominal_system_energy_kWh),
|
||||
)
|
||||
self.base_unique_id = "_".join(unique_group)
|
||||
|
||||
@@ -38,15 +28,13 @@ class PowerWallEntity(Entity):
|
||||
"""Powerwall device info."""
|
||||
device_info = {
|
||||
"identifiers": {(DOMAIN, self.base_unique_id)},
|
||||
"name": self._site_info[POWERWALL_SITE_NAME],
|
||||
"name": self._site_info.site_name,
|
||||
"manufacturer": MANUFACTURER,
|
||||
}
|
||||
model = MODEL
|
||||
if self._device_type:
|
||||
model += f" ({self._device_type})"
|
||||
model += f" ({self._device_type.name})"
|
||||
device_info["model"] = model
|
||||
if self._version:
|
||||
device_info["sw_version"] = self._version
|
||||
device_info["sw_version"] = self._version
|
||||
return device_info
|
||||
|
||||
@property
|
||||
|
||||
Reference in new issue
Block a user