Skip to content

Commit

Permalink
fix: add missing CONFIG_SCHEMA and service translations (#673)
Browse files Browse the repository at this point in the history
* fix: add missing CONFIG_SCHEMA

fixes https://github.com/alandtse/tesla/actions/runs/5677167144/job/15385034940

* fix: add missing translations

* fix: add missing translations

* fix: missing name as well

---------

Co-authored-by: Alan Tse <alandtse@users.noreply.github.com>
  • Loading branch information
bdraco and alandtse authored Aug 27, 2023
1 parent b993bc9 commit c5aad96
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
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: 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)"
}
}
}
}
}
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"
}

0 comments on commit c5aad96

Please sign in to comment.