Skip to content

Commit

Permalink
Updated powerwall site grid_status property to using site data instea…
Browse files Browse the repository at this point in the history
…d of summary
  • Loading branch information
ericdegroot committed Apr 4, 2024
1 parent 02ce700 commit 78218e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
- craigrouse [Github](https://github.com/craigrouse)
- thierryVT [Github](https://github.com/thierryvt)
- llamafilm [Github](https://github.com/llamafilm)
- ericdegroot [Github](https://github.com/ericdegroot)
2 changes: 1 addition & 1 deletion teslajsonpy/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def grid_power(self) -> float:
@property
def grid_status(self) -> str:
"""Return grid status."""
return self._site_summary.get("grid_status")
return self._site_data.get("grid_status")

@property
def load_power(self) -> float:
Expand Down
4 changes: 4 additions & 0 deletions tests/unit_tests/test_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ async def test_powerwall_site(monkeypatch):
_solar_powerwall_site.grid_power
== SITE_DATA["grid_power"]
)
assert (
_solar_powerwall_site.grid_status
== SITE_DATA["grid_status"]
)
assert (
_solar_powerwall_site.load_power
== SITE_DATA["load_power"]
Expand Down

0 comments on commit 78218e1

Please sign in to comment.