mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 18:57:57 +00:00
Don't reload integration for AuthError in Honeywell (#91228)
This commit is contained in:
parent
3364f0fce2
commit
799080eb00
@ -419,11 +419,6 @@ class HoneywellUSThermostat(ClimateEntity):
|
|||||||
try:
|
try:
|
||||||
await self._data.client.login()
|
await self._data.client.login()
|
||||||
|
|
||||||
except aiosomecomfort.AuthError:
|
|
||||||
self._attr_available = False
|
|
||||||
await self.hass.async_create_task(
|
|
||||||
self.hass.config_entries.async_reload(self._data.entry_id)
|
|
||||||
)
|
|
||||||
except (
|
except (
|
||||||
aiosomecomfort.SomeComfortError,
|
aiosomecomfort.SomeComfortError,
|
||||||
ClientConnectionError,
|
ClientConnectionError,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""Test the Whirlpool Sixth Sense climate domain."""
|
"""Test the Whirlpool Sixth Sense climate domain."""
|
||||||
import datetime
|
import datetime
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
from aiohttp import ClientConnectionError
|
||||||
import aiosomecomfort
|
import aiosomecomfort
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
@ -1020,7 +1021,6 @@ async def test_async_update_errors(
|
|||||||
# "reload integration" test
|
# "reload integration" test
|
||||||
device.refresh.side_effect = aiosomecomfort.SomeComfortError
|
device.refresh.side_effect = aiosomecomfort.SomeComfortError
|
||||||
client.login.side_effect = aiosomecomfort.AuthError
|
client.login.side_effect = aiosomecomfort.AuthError
|
||||||
with patch("homeassistant.config_entries.ConfigEntries.async_reload") as reload:
|
|
||||||
async_fire_time_changed(
|
async_fire_time_changed(
|
||||||
hass,
|
hass,
|
||||||
utcnow() + SCAN_INTERVAL,
|
utcnow() + SCAN_INTERVAL,
|
||||||
@ -1030,7 +1030,17 @@ async def test_async_update_errors(
|
|||||||
entity_id = f"climate.{device.name}"
|
entity_id = f"climate.{device.name}"
|
||||||
state = hass.states.get(entity_id)
|
state = hass.states.get(entity_id)
|
||||||
assert state.state == "unavailable"
|
assert state.state == "unavailable"
|
||||||
assert reload.called_once()
|
|
||||||
|
device.refresh.side_effect = ClientConnectionError
|
||||||
|
async_fire_time_changed(
|
||||||
|
hass,
|
||||||
|
utcnow() + SCAN_INTERVAL,
|
||||||
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
entity_id = f"climate.{device.name}"
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state.state == "unavailable"
|
||||||
|
|
||||||
|
|
||||||
async def test_aux_heat_off_service_call(
|
async def test_aux_heat_off_service_call(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user