Skip to content

Commit

Permalink
Version v0.3.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jrester committed Jun 25, 2022
1 parent 3325693 commit e95d712
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.3.18]

- updated examples
- add Metertype `busway` thanks to @maikukun (https://github.com/jrester/tesla_powerwall/pull/40)


## [0.3.17]

- move `py.typed` to correct location (https://github.com/jrester/tesla_powerwall/pull/35)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name="tesla_powerwall",
author="Jrester",
author_email="[email protected]",
version='0.3.17',
version='0.3.18',
description="API for Tesla Powerwall",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion tesla_powerwall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
Solar,
)

VERSION = "0.3.17"
VERSION = "0.3.18"
2 changes: 1 addition & 1 deletion tesla_powerwall/powerwall.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run(self) -> None:
def stop(self) -> None:
self._api.get_sitemaster_stop()

def get_charge(self) -> float:
def get_charge(self) -> Union[float, int]:
return assert_attribute(self._api.get_system_status_soe(), "percentage", "soe")

def get_energy(self) -> int:
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/test_powerwall.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def tearDown(self) -> None:

def test_get_charge(self) -> None:
charge = self.powerwall.get_charge()
self.assertIsInstance(charge, float)
if(charge < 100):
self.assertIsInstance(charge, float)
else:
self.assertEqual(charge, 100)

def test_get_meters(self) -> None:
meters = self.powerwall.get_meters()
Expand Down

0 comments on commit e95d712

Please sign in to comment.