Skip to content

Commit

Permalink
Merge pull request #695 from alandtse/dev
Browse files Browse the repository at this point in the history
chore: release 2023-08-26
  • Loading branch information
alandtse authored Aug 27, 2023
2 parents 3506e4b + 1c1dbe0 commit eadfb6a
Show file tree
Hide file tree
Showing 11 changed files with 713 additions and 805 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/semantic_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# run: |
# git commit -m "docs: update localization" -a
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
uses: relekang/python-semantic-release@v7.34.6
with:
github_token: ${{ secrets.GH_TOKEN }}
- name: Zip tesla dir
Expand Down
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: 23.3.0
rev: 23.7.0
- repo: https://github.com/pre-commit/mirrors-prettier
hooks:
- id: prettier
Expand Down
3 changes: 3 additions & 0 deletions custom_components/tesla_custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
)
from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.httpx_client import SERVER_SOFTWARE, USER_AGENT
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
Expand Down Expand Up @@ -48,6 +49,8 @@

_LOGGER = logging.getLogger(__name__)

CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)


@callback
def _async_save_tokens(hass, config_entry, access_token, refresh_token, expiration):
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 @@ -23,6 +23,6 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/alandtse/tesla/issues",
"loggers": ["teslajsonpy"],
"requirements": ["teslajsonpy==3.9.2"],
"requirements": ["teslajsonpy==3.9.3"],
"version": "3.15.1"
}
2 changes: 2 additions & 0 deletions custom_components/tesla_custom/services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
api:
name: Run API Command
# Description of the service
description: Run an API command using controller.api. https://teslajsonpy.readthedocs.io/en/latest/teslajsonpy/teslajsonpy.html#teslajsonpy.Controller.api
# Different fields that your service accepts
Expand Down Expand Up @@ -31,6 +32,7 @@ api:
object:

polling_interval:
name: Set Polling Interval
description: Set polling interval for updating fresh data from an awake car
fields:
email:
Expand Down
38 changes: 38 additions & 0 deletions custom_components/tesla_custom/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,43 @@
}
}
}
},
"services": {
"api": {
"name": "Run API Command",
"description": "Run an API command using controller.api",
"fields": {
"email": {
"name": "Email address",
"description": "Email address (optional if only one account)"
},
"command": {
"name": "Command",
"description": "Command to run. See https://github.com/zabuldon/teslajsonpy/blob/master/teslajsonpy/endpoints.json"
},
"parameters": {
"name": "Parameters",
"description": "Parameters in a dictionary. `path_vars` replace variables in endpoints.json path. All others are passed directly to controller.api. For command parameters see https://tesla-api.timdorr.com/vehicle/commands."
}
}
},
"polling_interval": {
"name": "Set Polling Interval",
"description": "Set the polling interval for the Tesla API",
"fields": {
"scan_interval": {
"name": "Interval (seconds)",
"description": "Number of seconds between each poll. See https://github.com/alandtse/tesla/wiki/Polling-policy more information."
},
"email": {
"name": "Email address",
"description": "Email address (optional if only one account)"
},
"vin": {
"name": "Vehicle VIN",
"description": "Vehicle VIN (if not provided then default polling interval will be updated)"
}
}
}
}
}
6 changes: 2 additions & 4 deletions custom_components/tesla_custom/teslamate.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ async def unload(self):
if mqtt_config_entry_enabled(self.hass):
await self._unsub_mqtt()
else:
logger.warning(
"Cannot unsub from TeslaMate as MQTT has not been configured."
)
logger.info("Cannot unsub from TeslaMate as MQTT has not been configured.")

return True

Expand Down Expand Up @@ -287,7 +285,7 @@ async def async_handle_new_data(self, msg: ReceiveMessage):

coordinator = self.coordinators[car.vin]

logger.info(
logger.debug(
"Got %s from MQTT for VIN:%s | TeslsMateID:%s",
mqtt_attr,
car.vin,
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Tesla",
"hacs": "1.6.0",
"homeassistant": "2023.4.0",
"homeassistant": "2023.6.0",
"zip_release": true,
"filename": "tesla_custom.zip"
}
1,457 changes: 662 additions & 795 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.10"
teslajsonpy = "3.9.0"
teslajsonpy = "3.9.3"


[tool.poetry.group.dev.dependencies]
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.9.0
pip install git+https://github.com/zabuldon/teslajsonpy.git@dev#teslajsonpy==3.9.3
pre-commit install --install-hooks

0 comments on commit eadfb6a

Please sign in to comment.