Skip to content

Commit

Permalink
Merge pull request #897 from alandtse/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse authored Mar 12, 2024
2 parents 89c0fe7 + 6d1a3ec commit edafc5e
Show file tree
Hide file tree
Showing 9 changed files with 1,566 additions and 915 deletions.
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Tesla Custom Component",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12",
"postCreateCommand": "sudo scripts/setup",
"appPort": ["9123:8123"],
"customizations": {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v2"
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v2"
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ repos:
- id: prospector
exclude: ^(tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
rev: 1.7.8
hooks:
- id: bandit
args:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ async def validate_input(hass: core.HomeAssistant, data) -> dict:
config[CONF_INCLUDE_ENERGYSITES] = data[CONF_INCLUDE_ENERGYSITES]
config[CONF_API_PROXY_URL] = data.get(CONF_API_PROXY_URL)
config[CONF_API_PROXY_CERT] = data.get(CONF_API_PROXY_CERT)
config[CONF_CLIENT_ID] = data.get(CONF_CLIENT_ID)
config[CONF_CLIENT_ID] = data.get(CONF_CLIENT_ID, "ownerapi")

except IncompleteCredentials as ex:
_LOGGER.error("Authentication error: %s %s", ex.message, ex)
Expand Down
2,452 changes: 1,551 additions & 901 deletions poetry.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ authors = ["Alan D. Tse <[email protected]>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.10"
python = ">=3.12,<3.13"
teslajsonpy = "3.10.1"
async-timeout = ">=4.0.0"


[tool.poetry.group.dev.dependencies]
homeassistant = ">=2023.4.0"
pytest-homeassistant-custom-component = ">=0.13.1"
homeassistant = ">=2024.3.0"
pytest-homeassistant-custom-component = ">=0.13.107"
bandit = ">=1.7.0"
black = { version = ">=21.12b0", allow-prereleases = true }
mypy = ">=0.812"
Expand All @@ -39,7 +40,7 @@ commit_subject = "[skip ci] {version}"

[tool.black]
line-length = 88
target-version = ['py310']
target-version = ['py312']
exclude = '''
(
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.11
pip install git+https://github.com/zabuldon/teslajsonpy.git@dev#teslajsonpy==3.10.1
pre-commit install --install-hooks
4 changes: 2 additions & 2 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def test_form(hass):
"initial_setup": True,
CONF_API_PROXY_URL: None,
CONF_API_PROXY_CERT: None,
CONF_CLIENT_ID: None,
CONF_CLIENT_ID: "ownerapi",
}
assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1
Expand Down Expand Up @@ -344,7 +344,7 @@ async def test_import(hass):
CONF_API_PROXY_ENABLE: False,
CONF_API_PROXY_CERT: None,
CONF_API_PROXY_URL: None,
CONF_CLIENT_ID: None,
CONF_CLIENT_ID: "ownerapi",
},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
Expand Down

0 comments on commit edafc5e

Please sign in to comment.