mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Add issue to ESPHome deprecating api password (#86606)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
60b799aac9
commit
d0b67689e0
@ -107,6 +107,30 @@ def _async_check_firmware_version(
|
||||
)
|
||||
|
||||
|
||||
@callback
|
||||
def _async_check_using_api_password(
|
||||
hass: HomeAssistant, device_info: EsphomeDeviceInfo, has_password: bool
|
||||
) -> None:
|
||||
"""Create or delete an the api_password_deprecated issue."""
|
||||
# ESPHome device_info.mac_address is the unique_id
|
||||
issue = f"api_password_deprecated-{device_info.mac_address}"
|
||||
if not has_password:
|
||||
async_delete_issue(hass, DOMAIN, issue)
|
||||
return
|
||||
async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
issue,
|
||||
is_fixable=False,
|
||||
severity=IssueSeverity.WARNING,
|
||||
learn_more_url="https://esphome.io/components/api.html",
|
||||
translation_key="api_password_deprecated",
|
||||
translation_placeholders={
|
||||
"name": device_info.name,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry( # noqa: C901
|
||||
hass: HomeAssistant, entry: ConfigEntry
|
||||
) -> bool:
|
||||
@ -309,6 +333,7 @@ async def async_setup_entry( # noqa: C901
|
||||
await cli.disconnect()
|
||||
else:
|
||||
_async_check_firmware_version(hass, device_info)
|
||||
_async_check_using_api_password(hass, device_info, bool(password))
|
||||
|
||||
async def on_disconnect() -> None:
|
||||
"""Run disconnect callbacks on API disconnect."""
|
||||
|
@ -50,6 +50,10 @@
|
||||
"ble_firmware_outdated": {
|
||||
"title": "Update {name} with ESPHome {version} or later",
|
||||
"description": "To improve Bluetooth reliability and performance, we highly recommend updating {name} with ESPHome {version} or later. When updating the device to ESPHome {version}, it is recommended to use a serial cable instead of an over-the-air update to take advantage of the new partition scheme."
|
||||
},
|
||||
"api_password_deprecated": {
|
||||
"title": "API Password deprecated on {name}",
|
||||
"description": "The API password for ESPHome is deprecated and the use of an API encryption key is recommended instead.\n\nRemove the API password and add an encryption key to your ESPHome device to resolve this issue."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,10 @@
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"api_password_deprecated": {
|
||||
"description": "The API password for ESPHome is deprecated and the use of an API encryption key is recommended instead.\n\nRemove the API password and add an encryption key to your ESPHome device to resolve this issue.",
|
||||
"title": "API Password deprecated on {name}"
|
||||
},
|
||||
"ble_firmware_outdated": {
|
||||
"description": "To improve Bluetooth reliability and performance, we highly recommend updating {name} with ESPHome {version} or later. When updating the device to ESPHome {version}, it is recommended to use a serial cable instead of an over-the-air update to take advantage of the new partition scheme.",
|
||||
"title": "Update {name} with ESPHome {version} or later"
|
||||
|
Loading…
x
Reference in New Issue
Block a user