Update tesla_powerwall to 0.3.3 (#41482)

This commit is contained in:
jrester authored and GitHub committed 2020-10-08 08:26:44 -05:00
1 parent 07d208f1bc
commit 734972f876
10 files changed
+38 -42

No files matched your search

@@ -19,7 +19,6 @@ from .const import (
POWERWALL_API_SITE_INFO,
POWERWALL_API_SITEMASTER,
POWERWALL_API_STATUS,
POWERWALL_BATTERY_METER,
POWERWALL_COORDINATOR,
)
from .entity import PowerWallEntity
@@ -74,7 +73,7 @@ class PowerWallRunningSensor(PowerWallEntity, BinarySensorEntity):
@property
def is_on(self):
"""Get the powerwall running state."""
return self.coordinator.data[POWERWALL_API_SITEMASTER].running
return self.coordinator.data[POWERWALL_API_SITEMASTER].is_running
class PowerWallConnectedSensor(PowerWallEntity, BinarySensorEntity):
@@ -98,7 +97,7 @@ class PowerWallConnectedSensor(PowerWallEntity, BinarySensorEntity):
@property
def is_on(self):
"""Get the powerwall connected to tesla state."""
return self.coordinator.data[POWERWALL_API_SITEMASTER].connected_to_tesla
return self.coordinator.data[POWERWALL_API_SITEMASTER].is_connected_to_tesla
class PowerWallGridStatusSensor(PowerWallEntity, BinarySensorEntity):
@@ -147,6 +146,4 @@ class PowerWallChargingStatusSensor(PowerWallEntity, BinarySensorEntity):
def is_on(self):
"""Powerwall is charging."""
# is_sending_to returns true for values greater than 100 watts
return self.coordinator.data[POWERWALL_API_METERS][
POWERWALL_BATTERY_METER
].is_sending_to()
return self.coordinator.data[POWERWALL_API_METERS].battery.is_sending_to()