Skip to content

Commit

Permalink
Powerwall add Current attribute (#50550)
Browse files Browse the repository at this point in the history
  • Loading branch information
quielb committed May 13, 2021
1 parent 136b34a commit c079803
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/powerwall/__init__.py
Expand Up @@ -176,7 +176,7 @@ async def _async_update_powerwall_data(
def _login_and_fetch_base_info(power_wall: Powerwall, password: str):
"""Login to the powerwall and fetch the base info."""
if password is not None:
power_wall.login("", password)
power_wall.login(password)
power_wall.detect_and_pin_version()
return call_base_info(power_wall)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/powerwall/config_flow.py
Expand Up @@ -21,7 +21,7 @@
def _login_and_fetch_site_info(power_wall: Powerwall, password: str):
"""Login to the powerwall and fetch the base info."""
if password is not None:
power_wall.login("", password)
power_wall.login(password)
power_wall.detect_and_pin_version()
return power_wall.get_site_info()

Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/powerwall/const.py
Expand Up @@ -12,6 +12,7 @@
ATTR_ENERGY_EXPORTED = "energy_exported_(in_kW)"
ATTR_ENERGY_IMPORTED = "energy_imported_(in_kW)"
ATTR_INSTANT_AVERAGE_VOLTAGE = "instant_average_voltage"
ATTR_INSTANT_TOTAL_CURRENT = "instant_total_current"
ATTR_IS_ACTIVE = "is_active"

STATUS_VERSION = "version"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/powerwall/manifest.json
Expand Up @@ -3,7 +3,7 @@
"name": "Tesla Powerwall",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/powerwall",
"requirements": ["tesla-powerwall==0.3.5"],
"requirements": ["tesla-powerwall==0.3.10"],
"codeowners": ["@bdraco", "@jrester"],
"dhcp": [
{
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/powerwall/sensor.py
Expand Up @@ -11,6 +11,7 @@
ATTR_ENERGY_IMPORTED,
ATTR_FREQUENCY,
ATTR_INSTANT_AVERAGE_VOLTAGE,
ATTR_INSTANT_TOTAL_CURRENT,
ATTR_IS_ACTIVE,
DOMAIN,
ENERGY_KILO_WATT,
Expand Down Expand Up @@ -144,6 +145,7 @@ def extra_state_attributes(self):
ATTR_FREQUENCY: round(meter.frequency, 1),
ATTR_ENERGY_EXPORTED: meter.get_energy_exported(),
ATTR_ENERGY_IMPORTED: meter.get_energy_imported(),
ATTR_INSTANT_AVERAGE_VOLTAGE: round(meter.avarage_voltage, 1),
ATTR_INSTANT_AVERAGE_VOLTAGE: round(meter.average_voltage, 1),
ATTR_INSTANT_TOTAL_CURRENT: meter.get_instant_total_current(),
ATTR_IS_ACTIVE: meter.is_active(),
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -2220,7 +2220,7 @@ temperusb==1.5.3
# tensorflow==2.3.0

# homeassistant.components.powerwall
tesla-powerwall==0.3.5
tesla-powerwall==0.3.10

# homeassistant.components.tesla
teslajsonpy==0.18.3
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Expand Up @@ -1189,7 +1189,7 @@ systembridge==1.1.5
tellduslive==0.10.11

# homeassistant.components.powerwall
tesla-powerwall==0.3.5
tesla-powerwall==0.3.10

# homeassistant.components.tesla
teslajsonpy==0.18.3
Expand Down

0 comments on commit c079803

Please sign in to comment.