fix: resolve hassfest validation errors and warnings (#1800)

This commit is contained in:
Li Shuzhen
2026-09-23 15:42:04 +08:00
committed by GitHub
parent e22c900de1
commit 77c4c09823
15 changed files with 69 additions and 53 deletions

View File

@@ -308,6 +308,9 @@ class XiaomiMihomeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
): bool,
}),
errors={'base': reason},
description_placeholders={
'oauth_redirect_url': OAUTH_REDIRECT_URL,
},
last_step=False,
)
@@ -417,7 +420,12 @@ class XiaomiMihomeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
'http_host': (
DEFAULT_OAUTH2_API_HOST
if self._cloud_server == DEFAULT_CLOUD_SERVER
else f'{self._cloud_server}.{DEFAULT_OAUTH2_API_HOST}')},
else f'{self._cloud_server}.{DEFAULT_OAUTH2_API_HOST}'),
'bing_url': 'https://www.bing.com',
'oauth2_auth_url': OAUTH2_AUTH_URL,
'spec_api_url':
'https://miot-spec.org/miot-spec-v2/template/list/device',
},
last_step=False
)
@@ -1183,6 +1191,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
}),
description_placeholders={
'cloud_server': CLOUD_SERVERS[self._cloud_server],
'oauth_redirect_url': OAUTH_REDIRECT_URL,
},
last_step=False,
)
@@ -1926,7 +1935,12 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
'http_host': (
DEFAULT_OAUTH2_API_HOST
if self._cloud_server == DEFAULT_CLOUD_SERVER
else f'{self._cloud_server}.{DEFAULT_OAUTH2_API_HOST}')},
else f'{self._cloud_server}.{DEFAULT_OAUTH2_API_HOST}'),
'bing_url': 'https://www.bing.com',
'oauth2_auth_url': OAUTH2_AUTH_URL,
'spec_api_url':
'https://miot-spec.org/miot-spec-v2/template/list/device',
},
last_step=False
)