diff --git a/custom_components/cryptostate/config_flow.py b/custom_components/cryptostate/config_flow.py index d660add..327e021 100644 --- a/custom_components/cryptostate/config_flow.py +++ b/custom_components/cryptostate/config_flow.py @@ -28,8 +28,6 @@ async def async_step_user(self, user_input=None): return self.async_create_entry( title=user_input[CONF_NAME], data=user_input ) - else: - self._errors["base"] = "invalid_format" return await self._show_config_form(user_input) @@ -65,8 +63,10 @@ async def _test_credentials(self, crypto, base): if base in currencies: return True else: + self._errors[CONF_BASE] = "invalid_base" return False else: + self._errors[CONF_CRYPTO] = "invalid_crypto" return False except Exception: pass diff --git a/custom_components/cryptostate/translations/en.json b/custom_components/cryptostate/translations/en.json index 1db948e..0b105f3 100644 --- a/custom_components/cryptostate/translations/en.json +++ b/custom_components/cryptostate/translations/en.json @@ -7,13 +7,15 @@ "description": "If you need help, go on the component page: https://github.com/BigNocciolino/CryptoTracker", "data": { "name": "Name", - "crypto": "Crypto", - "base": "Base" + "crypto": "Crypto ticker", + "base": "Base ticker" } } }, "error": { - "invalid_format": "Invalid format, for a list of supported currencies see: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json" + "invalid_crypto": "Invalid crypto format, for a list of supported currencies see: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json", + "invalid_base": "Invalid base format, for a list of supported currencies see: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json" + } } } \ No newline at end of file diff --git a/custom_components/cryptostate/translations/it.json b/custom_components/cryptostate/translations/it.json index 52c8adf..fd485af 100644 --- a/custom_components/cryptostate/translations/it.json +++ b/custom_components/cryptostate/translations/it.json @@ -13,7 +13,8 @@ } }, "error": { - "invalid_format": "Formato invalido, per una lista di monete supportate guarda: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json" + "invalid_crypto": "Formato cryptovaluta invalido invalido, per una lista di monete supportate guarda: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json", + "invalid_base": "Formato cryptovaluta invalido invalido, per una lista di monete supportate guarda: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json" } } } \ No newline at end of file