Skip to content

Commit

Permalink
fix: bump teslajsonpy to 3.10.3 (#919) (#942)
Browse files Browse the repository at this point in the history
closes #919
  • Loading branch information
gkwok1 authored Apr 14, 2024
1 parent f2f9c33 commit a4aeb6c
Show file tree
Hide file tree
Showing 7 changed files with 656 additions and 371 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.0
- repo: https://github.com/pre-commit/mirrors-prettier
hooks:
- id: prettier
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/alandtse/tesla/issues",
"loggers": ["teslajsonpy"],
"requirements": ["teslajsonpy==3.10.2"],
"requirements": ["teslajsonpy==3.10.3"],
"version": "3.20.5"
}
1,012 changes: 649 additions & 363 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "Apache-2.0"

[tool.poetry.dependencies]
python = ">=3.12,<3.13"
teslajsonpy = "3.10.2"
teslajsonpy = "3.10.3"
async-timeout = ">=4.0.0"


Expand Down
2 changes: 1 addition & 1 deletion scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ poetry config virtualenvs.create false
poetry install --no-interaction

# Keep this inline with any requirements that are in manifest.json
pip install git+https://github.com/zabuldon/teslajsonpy.git@dev#teslajsonpy==3.10.2
pip install git+https://github.com/zabuldon/teslajsonpy.git@dev#teslajsonpy==3.10.3
pre-commit install --install-hooks
3 changes: 0 additions & 3 deletions tests/mock_data/energysite.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@

SITE_DATA = {
"solar_power": 7720,
"energy_left": 0,
"total_pack_energy": 1,
"percentage_charged": 0,
"battery_power": 0,
Expand All @@ -396,7 +395,6 @@

BATTERY_DATA = {
"site_name": "Battery Home",
"energy_left": 0,
"total_pack_energy": 1,
"grid_status": "Active",
"backup": {
Expand Down Expand Up @@ -498,7 +496,6 @@
BATTERY_SUMMARY = {
"site_name": "Battery Home",
"id": "XXX",
"energy_left": 13610.736842105263,
"total_pack_energy": 14056,
"percentage_charged": 96.8322199922116,
"battery_power": 370,
Expand Down
4 changes: 3 additions & 1 deletion tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ async def test_battery_remaining(hass: HomeAssistant) -> None:

state = hass.states.get("sensor.battery_home_battery_remaining")
assert float(state.state) == round(
energysite_mock_data.BATTERY_SUMMARY["energy_left"]
energysite_mock_data.SITE_CONFIG_POWERWALL["nameplate_energy"]
* energysite_mock_data.BATTERY_SUMMARY["percentage_charged"]
/ 100
)

assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY_STORAGE
Expand Down

0 comments on commit a4aeb6c

Please sign in to comment.