From eeecfe0dbcdc8d0360f8b474fcb8635dd8e2aeb0 Mon Sep 17 00:00:00 2001 From: "sourcery-ai[bot]" <58596630+sourcery-ai[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:28:14 +0200 Subject: [PATCH] Sourcery refactored main branch (#129) * 'Refactored by Sourcery' * fix manifest style. --------- Co-authored-by: Sourcery AI <> Co-authored-by: vlebourl --- custom_components/vesync/config_flow.py | 16 ++++++++++------ custom_components/vesync/manifest.json | 12 ++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/custom_components/vesync/config_flow.py b/custom_components/vesync/config_flow.py index 03c3c88..edba11c 100644 --- a/custom_components/vesync/config_flow.py +++ b/custom_components/vesync/config_flow.py @@ -53,12 +53,16 @@ class VeSyncFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): await self.async_set_unique_id(f"{self._username}-{manager.account_id}") self._abort_if_unique_id_configured() - if not login: - return self._show_form(errors={"base": "invalid_auth"}) - - return self.async_create_entry( - title=self._username, - data={CONF_USERNAME: self._username, CONF_PASSWORD: self._password}, + return ( + self.async_create_entry( + title=self._username, + data={ + CONF_USERNAME: self._username, + CONF_PASSWORD: self._password, + }, + ) + if login + else self._show_form(errors={"base": "invalid_auth"}) ) async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult: diff --git a/custom_components/vesync/manifest.json b/custom_components/vesync/manifest.json index 2eb2908..ad2d941 100644 --- a/custom_components/vesync/manifest.json +++ b/custom_components/vesync/manifest.json @@ -1,17 +1,17 @@ { "domain": "vesync", "name": "VeSync", - "documentation": "https://www.home-assistant.io/integrations/vesync", "codeowners": ["@markperdue", "@webdjoe", "@thegardenmonkey", "@vlebourl"], - "requirements": ["pyvesync==2.1.1"], "config_flow": true, - "iot_class": "cloud_polling", - "version": "0.2.5", - "issue_tracker": "https://github.com/vlebourl/custom_vesync", "dhcp": [ { "hostname": "levoit-*", "macaddress": "*" } - ] + ], + "documentation": "https://www.home-assistant.io/integrations/vesync", + "iot_class": "cloud_polling", + "issue_tracker": "https://github.com/vlebourl/custom_vesync", + "requirements": ["pyvesync==2.1.1"], + "version": "0.2.5" }