From f61c23c4f2c8b6111a685c8226275ce1c8f82be3 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:12:33 +1300 Subject: [PATCH 1/8] update docs --- .github/ISSUE_TEMPLATE/config.yml | 5 +++++ README.md | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..81fed42 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Start a discussion (config, doubts, docs) + url: https://github.com/jbergler/hass-ttlock/discussions + about: If you have general questions, or are unsure about wether a bug report is the right thing to open, click here to create a Discussion instead of an Issue. diff --git a/README.md b/README.md index fea8a51..1d57aea 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ This integration uses the TTLock Cloud to communicate with your lock. It support 1. A TTLock based smart lock 1. A Gateway (if your lock doesn't have integrated wifi) - These can be purchased from the vendor of your lock or direct from [Aliexpress](https://s.click.aliexpress.com/e/_DEPpClx) +1. Remote unlock must be enabled for each lock + - This must be done while in bluetooth range of the lock, from the mobile app + - Here is a [youtube video](https://www.youtube.com/watch?v=ni-38QpoNA4) which explains the process ## Creating an OAuth APP @@ -44,16 +47,32 @@ This integration uses the TTLock Cloud to communicate with your lock. It support 1. Register an application (this will take a few days to get approved) 1. Install the extension [via HACS](https://my.home-assistant.io/redirect/hacs_repository/?owner=jbergler&repository=hass-ttlock&category=integration) and restart Home Assistant 1. Setup the integration [via Home Assistant UI](https://my.home-assistant.io/redirect/config_flow_start/?domain=ttlock) + - The first credentials you will be prompted for are the Application Client ID & Secret that you created earlier. + - The second credentials you will be prompted for are the username/password you use to login to the ttlock app on your phone. 1. Once the integration is working you should receive a system notification with the webhook url - This will go away when the webhook receives data 1. Go back to the url from the first step and set the 'Callback URL' for your application +# Troubleshooting + +## Common issues +1. Invalid client_id + - Your Application (ie oauth) Client ID & Client Secret for the application you created on open.ttlock.com. + - These are stored in the "Application Credentials" feature of Home Assistant. If you need to remove/update them, please follow the official [docs](https://www.home-assistant.io/integrations/application_credentials) + - If you get this error, you need to remove the invalid credentials and re-setup the integration with the correct ones. +1. Invalid username or password + - The username/password for open.ttlock.com is only used for managing API credentials for the ttlock cloud - do not use these within home assistant. + - The username/password for the ttlock (or 3rd party branded) mobile app. This is the account that will work. +1. "Failed to execute the action lock/lock." or "The function is not supported for this lock" + - This is most likely because you haven't enabled remote unlock, please follow the instructions in the requirements section. + ## Reporting issues When reporting issues, please attach the diagnostic information and consider enabling debug logging to provide extra information. -## Say thanks +# Say thanks -If you found this helpful and you'd like to say thanks you can do so via buy me a coffee. Thanks! +If you found this helpful and you'd like to say thanks you can do so via buy me a coffee or a beer. +I've put a bunch of time into this integration and it always puts a smile on my face when people say thanks! From 3fca79b338f0a6db2892874e09ae965e56c15ca7 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:19:11 +1300 Subject: [PATCH 2/8] fix deps --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f36c317..9baa512 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.11" -homeassistant = "^2023.3.6" +homeassistant = "^2024.12.1" [build-system] From 930bcccc56fedf01a7131bf7a68b9dd7de1f6eaa Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:23:25 +1300 Subject: [PATCH 3/8] sp --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 81fed42..8952213 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: false contact_links: - name: Start a discussion (config, doubts, docs) url: https://github.com/jbergler/hass-ttlock/discussions - about: If you have general questions, or are unsure about wether a bug report is the right thing to open, click here to create a Discussion instead of an Issue. + about: If you have general questions, or are unsure about whether a bug report is the right thing to open, click here to create a Discussion instead of an Issue. From c4b2ac7735ae1fd203de65be7f36a7e576651db2 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:25:09 +1300 Subject: [PATCH 4/8] formatting --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1d57aea..5a1ace8 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ This integration uses the TTLock Cloud to communicate with your lock. It support # Troubleshooting ## Common issues + 1. Invalid client_id - Your Application (ie oauth) Client ID & Client Secret for the application you created on open.ttlock.com. - These are stored in the "Application Credentials" feature of Home Assistant. If you need to remove/update them, please follow the official [docs](https://www.home-assistant.io/integrations/application_credentials) From 2914234d00bd344f4bf345d9100b45402419b23a Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:27:06 +1300 Subject: [PATCH 5/8] python version --- .github/workflows/lint_test.yml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint_test.yml b/.github/workflows/lint_test.yml index c5f3fb6..ff6ecf2 100644 --- a/.github/workflows/lint_test.yml +++ b/.github/workflows/lint_test.yml @@ -39,7 +39,7 @@ jobs: - name: Setup Python uses: "actions/setup-python@v4" with: - python-version: "3.11" + python-version: "3.12" - name: Install requirements run: python3 -m pip install -r requirements.txt - name: Run tests diff --git a/pyproject.toml b/pyproject.toml index 9baa512..1a4dfe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Jonas Bergler "] readme = "README.md" [tool.poetry.dependencies] -python = "^3.11" +python = "^3.12" homeassistant = "^2024.12.1" @@ -32,7 +32,7 @@ forced_separate = [ combine_as_imports = true [tool.pylint.MAIN] -py-version = "3.10" +py-version = "3.12" ignore = [ "tests", ] @@ -176,7 +176,7 @@ asyncio_mode = "auto" filterwarnings = [] [tool.ruff] -target-version = "py311" +target-version = "py312" select = [ "B007", # Loop control variable {name} not used within loop body From d5277f54077dcbd7368cfb55f59ff81b76316641 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:30:52 +1300 Subject: [PATCH 6/8] ruff config --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1a4dfe9..3e39565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -176,7 +176,7 @@ asyncio_mode = "auto" filterwarnings = [] [tool.ruff] -target-version = "py312" +target-version = "py311" select = [ "B007", # Loop control variable {name} not used within loop body From 97fa24f22bde3da6f8ec4fb84c0e62d184665c00 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:34:03 +1300 Subject: [PATCH 7/8] missing test deps --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 7a6bd30..d098476 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,6 @@ home-assistant-intents mutagen python-matter-server ha-ffmpeg +pymicro_vad aiohttp_cors # http component dateparser # tests \ No newline at end of file From 432f2da9c35282280328e7379e8c358a68baf7e3 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Mon, 9 Dec 2024 22:35:36 +1300 Subject: [PATCH 8/8] missing test deps 2 --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index d098476..630e944 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ pytest-homeassistant-custom-component + # cloud component hass_nabucasa webrtcvad @@ -8,5 +9,7 @@ mutagen python-matter-server ha-ffmpeg pymicro_vad +pyspeex_noise + aiohttp_cors # http component dateparser # tests \ No newline at end of file