Skip to content

Commit 2b26b0c

Browse files
authored
Merge pull request #499 from zabuldon/dev
2 parents e4c2786 + 11bbbdb commit 2b26b0c

File tree

6 files changed

+138
-34
lines changed

6 files changed

+138
-34
lines changed

.github/workflows/semantic_release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
github_token: ${{ secrets.GITHUB_TOKEN }}
5656
git_committer_name: "github-actions"
5757
git_committer_email: "actions@users.noreply.github.com"
58+
commit: true
59+
push: true
5860
- name: Publish | Upload to GitHub Release Assets
5961
uses: python-semantic-release/publish-action@v10.2.0
6062
if: steps.release.outputs.released == 'true'

poetry.lock

Lines changed: 120 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "teslajsonpy"
3-
version = "3.13.0"
3+
version = "3.13.1"
44
description = "A library to work with Tesla API."
55
authors = ["Sergey Isachenko <sergey.isachenkol@bool.by>"]
66
license = "Apache-2.0"
@@ -53,5 +53,15 @@ pylint = ">=2.7.3"
5353
requires = ["poetry-core>=1.0.0"]
5454
build-backend = "poetry.core.masonry.api"
5555

56-
[metadata]
57-
description-file = "README.md"
56+
[tool.semantic_release]
57+
version_toml = [
58+
"pyproject.toml:tool.poetry.version"
59+
]
60+
version_variable = [
61+
"teslajsonpy/__version__.py:__version__"
62+
]
63+
upload_to_pypi = true
64+
check_build_status = false
65+
remove_dist = false
66+
hvcs = "github"
67+
build_command = "pip install poetry && poetry build"

setup.cfg

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
[semantic_release]
2-
version_variable=pyproject.toml:version,teslajsonpy/__version__.py:__version__
3-
upload_to_pypi=true
4-
check_build_status=false
5-
remove_dist=false
6-
hvcs=github
7-
build_command=pip install poetry && poetry build
8-
91
[pydocstyle]
102
ignore = D202, D212, D416, D213, D203, D407
113

teslajsonpy/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
For more details about this api, please refer to the documentation at
66
https://github.com/zabuldon/teslajsonpy
77
"""
8-
__version__ = "3.13.0"
8+
__version__ = "3.13.1"

teslajsonpy/energy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def data_available(self) -> bool:
149149
@property
150150
def energy_left(self) -> float:
151151
"""Return battery energy left in Watt hours."""
152-
return round(self._site_config.get("nameplate_energy") * self.percentage_charged / 100)
152+
return round(self._site_config.get("nameplate_energy", 0) * self.percentage_charged / 100)
153153

154154
@property
155155
def grid_power(self) -> float:
@@ -175,7 +175,7 @@ def operation_mode(self) -> str:
175175
def percentage_charged(self) -> float:
176176
"""Return battery percentage charged."""
177177
# percentage_charged sometimes incorrectly reports 0
178-
return self._site_summary.get("percentage_charged")
178+
return self._site_summary.get("percentage_charged", 0)
179179

180180
@property
181181
def site_name(self) -> str:

0 commit comments

Comments
 (0)