From a0dc83e3a14d0e00b609247ad6291e805c2dcd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Fri, 14 Aug 2020 13:29:56 +0200 Subject: [PATCH 1/2] Use executor for sync in async --- custom_components/grocy/config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/grocy/config_flow.py b/custom_components/grocy/config_flow.py index 32174b4..bb96f59 100644 --- a/custom_components/grocy/config_flow.py +++ b/custom_components/grocy/config_flow.py @@ -86,7 +86,7 @@ async def _test_credentials(self, url, api_key, port, verify_ssl): """Return true if credentials is valid.""" try: client = Grocy(url, api_key, port, verify_ssl) - client.stock() + await self.hass.async_add_executor_job(client.stock) return True except Exception as e: # pylint: disable=broad-except _LOGGER.exception(e) From a657f8d4a543e39e9c6fe243d7636a215485d362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isabella=20Gross=20Alstr=C3=B6m?= Date: Fri, 14 Aug 2020 14:04:39 +0200 Subject: [PATCH 2/2] Upgrade pygrocy to 0.17.0 --- .vscode/settings.json | 5 +++++ custom_components/grocy/manifest.json | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a04b218 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.yaml": "home-assistant" + } +} \ No newline at end of file diff --git a/custom_components/grocy/manifest.json b/custom_components/grocy/manifest.json index a6ac1bb..37515f7 100644 --- a/custom_components/grocy/manifest.json +++ b/custom_components/grocy/manifest.json @@ -4,6 +4,13 @@ "documentation": "https://github.com/custom-components/grocy", "dependencies": [], "config_flow": true, - "codeowners": ["@SebRut", "@isabellaalstrom"], - "requirements": ["pygrocy==0.16.0", "iso8601==0.1.12", "integrationhelper"] -} + "codeowners": [ + "@SebRut", + "@isabellaalstrom" + ], + "requirements": [ + "pygrocy==0.17.0", + "iso8601==0.1.12", + "integrationhelper" + ] +} \ No newline at end of file