From e95d7120a3325a9da3243744b13fdbf6d797f72b Mon Sep 17 00:00:00 2001 From: jrester Date: Sat, 25 Jun 2022 12:52:33 +0200 Subject: [PATCH] Version v0.3.18 --- CHANGELOG | 6 ++++++ setup.py | 2 +- tesla_powerwall/__init__.py | 2 +- tesla_powerwall/powerwall.py | 2 +- tests/integration/test_powerwall.py | 5 ++++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 561df79..00994a4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/setup.py b/setup.py index cddfd83..193acc2 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ name="tesla_powerwall", author="Jrester", author_email="jrester379@gmail.com", - version='0.3.17', + version='0.3.18', description="API for Tesla Powerwall", long_description=long_description, long_description_content_type="text/markdown", diff --git a/tesla_powerwall/__init__.py b/tesla_powerwall/__init__.py index d1c5d02..ed0e639 100644 --- a/tesla_powerwall/__init__.py +++ b/tesla_powerwall/__init__.py @@ -33,4 +33,4 @@ Solar, ) -VERSION = "0.3.17" +VERSION = "0.3.18" diff --git a/tesla_powerwall/powerwall.py b/tesla_powerwall/powerwall.py index a5df47f..89deac3 100644 --- a/tesla_powerwall/powerwall.py +++ b/tesla_powerwall/powerwall.py @@ -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: diff --git a/tests/integration/test_powerwall.py b/tests/integration/test_powerwall.py index cfb7f52..a669e2d 100644 --- a/tests/integration/test_powerwall.py +++ b/tests/integration/test_powerwall.py @@ -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()