1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

ESPHome handle remove password and no encryption (#86995)

* ESPHome handle remove password and no encryption

* Start reauth for invalid api password

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Paulus Schoutsen
2023-01-30 23:05:48 -05:00
committed by GitHub
parent e706696271
commit d88849fb04
4 changed files with 54 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
"""Test ESPHome dashboard features."""
from unittest.mock import patch
from aioesphomeapi import DeviceInfo
from aioesphomeapi import DeviceInfo, InvalidAuthAPIError
from homeassistant.components.esphome import CONF_NOISE_PSK, dashboard
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState
@@ -31,7 +31,10 @@ async def test_new_dashboard_fix_reauth(
hass, mock_client, mock_config_entry, mock_dashboard
):
"""Test config entries waiting for reauth are triggered."""
mock_client.device_info.return_value = DeviceInfo(uses_password=False, name="test")
mock_client.device_info.side_effect = (
InvalidAuthAPIError,
DeviceInfo(uses_password=False, name="test"),
)
with patch(
"homeassistant.components.esphome.dashboard.ESPHomeDashboardAPI.get_encryption_key",