diff --git a/custom_components/xiaomi_gateway3/config_flow.py b/custom_components/xiaomi_gateway3/config_flow.py index 02c78171..a6506612 100644 --- a/custom_components/xiaomi_gateway3/config_flow.py +++ b/custom_components/xiaomi_gateway3/config_flow.py @@ -48,7 +48,7 @@ async def async_step_user(self, user_input=None): description_placeholders={'error_text': ''} ) - if 'devices' in self.hass.data[DOMAIN]: + if DOMAIN in self.hass.data and 'devices' in self.hass.data[DOMAIN]: for device in self.hass.data[DOMAIN]['devices']: if (device['model'] == 'lumi.gateway.mgl03' and device['did'] not in ACTIONS): @@ -65,7 +65,7 @@ async def async_step_user(self, user_input=None): async def async_step_cloud(self, user_input=None, error=None): if user_input: if not user_input['servers']: - return self.async_step_cloud(error='no_servers') + return await self.async_step_cloud(error='no_servers') session = async_create_clientsession(self.hass) cloud = MiCloud(session) @@ -76,7 +76,7 @@ async def async_step_cloud(self, user_input=None, error=None): data=user_input) else: - return self.async_step_cloud(error='cant_login') + return await self.async_step_cloud(error='cant_login') return self.async_show_form( step_id='cloud', diff --git a/custom_components/xiaomi_gateway3/translations/en.json b/custom_components/xiaomi_gateway3/translations/en.json index 519d2f0b..4575dbb0 100644 --- a/custom_components/xiaomi_gateway3/translations/en.json +++ b/custom_components/xiaomi_gateway3/translations/en.json @@ -2,7 +2,7 @@ "config": { "error": { "no_servers": "Please select at least one server", - "cant_login": "Can't login. Check logs for more info" + "cant_login": "Can't login, check username and password" }, "step": { "user": {