diff --git a/homeassistant/components/deconz/fan.py b/homeassistant/components/deconz/fan.py index 6192421ecdc..dc65756eeeb 100644 --- a/homeassistant/components/deconz/fan.py +++ b/homeassistant/components/deconz/fan.py @@ -66,7 +66,6 @@ class DeconzFan(DeconzDevice[Light], FanEntity): def __init__(self, device: Light, hub: DeconzHub) -> None: """Set up fan.""" super().__init__(device, hub) - _attr_speed_count = len(ORDERED_NAMED_FAN_SPEEDS) if device.fan_speed in ORDERED_NAMED_FAN_SPEEDS: self._default_on_speed = device.fan_speed diff --git a/tests/components/deconz/test_alarm_control_panel.py b/tests/components/deconz/test_alarm_control_panel.py index 712dddc7225..6c47146f9b0 100644 --- a/tests/components/deconz/test_alarm_control_panel.py +++ b/tests/components/deconz/test_alarm_control_panel.py @@ -24,7 +24,6 @@ from homeassistant.const import ( STATE_ALARM_DISARMED, STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, - STATE_UNAVAILABLE, Platform, ) from homeassistant.core import HomeAssistant @@ -158,10 +157,3 @@ async def test_alarm_control_panel( blocking=True, ) assert aioclient_mock.mock_calls[0][2] == {"code0": code} - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get("alarm_control_panel.keypad").state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_binary_sensor.py b/tests/components/deconz/test_binary_sensor.py index 78f6a5f4b0e..59d31afb9fc 100644 --- a/tests/components/deconz/test_binary_sensor.py +++ b/tests/components/deconz/test_binary_sensor.py @@ -14,7 +14,7 @@ from homeassistant.components.deconz.const import ( DOMAIN as DECONZ_DOMAIN, ) from homeassistant.components.deconz.services import SERVICE_DEVICE_REFRESH -from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE, Platform +from homeassistant.const import STATE_OFF, STATE_ON, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -344,17 +344,6 @@ async def test_binary_sensors( await sensor_ws_data({"state": expected["websocket_event"]}) assert hass.states.get(expected["entity_id"]).state == expected["next_state"] - # Unload entry - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get(expected["entity_id"]).state == STATE_UNAVAILABLE - - # Remove entry - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", diff --git a/tests/components/deconz/test_button.py b/tests/components/deconz/test_button.py index 76fcd784634..c649dba5b00 100644 --- a/tests/components/deconz/test_button.py +++ b/tests/components/deconz/test_button.py @@ -8,7 +8,7 @@ import pytest from syrupy import SnapshotAssertion from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS -from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, Platform +from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -101,14 +101,3 @@ async def test_button( blocking=True, ) assert aioclient_mock.mock_calls[1][2] == expected["request_data"] - - # Unload entry - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get(expected["entity_id"]).state == STATE_UNAVAILABLE - - # Remove entry - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_climate.py b/tests/components/deconz/test_climate.py index c9104a5583a..7f456e81976 100644 --- a/tests/components/deconz/test_climate.py +++ b/tests/components/deconz/test_climate.py @@ -30,13 +30,7 @@ from homeassistant.components.deconz.climate import ( DECONZ_PRESET_MANUAL, ) from homeassistant.components.deconz.const import CONF_ALLOW_CLIP_SENSOR -from homeassistant.const import ( - ATTR_ENTITY_ID, - ATTR_TEMPERATURE, - STATE_OFF, - STATE_UNAVAILABLE, - Platform, -) +from homeassistant.const import ATTR_ENTITY_ID, ATTR_TEMPERATURE, STATE_OFF, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import entity_registry as er @@ -277,17 +271,6 @@ async def test_climate_device_without_cooling_support( blocking=True, ) - await hass.config_entries.async_unload(config_entry.entry_id) - - states = hass.states.async_all() - assert len(states) == 1 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", diff --git a/tests/components/deconz/test_cover.py b/tests/components/deconz/test_cover.py index a93d40b4d1e..f1573394fae 100644 --- a/tests/components/deconz/test_cover.py +++ b/tests/components/deconz/test_cover.py @@ -20,7 +20,7 @@ from homeassistant.components.cover import ( SERVICE_STOP_COVER, SERVICE_STOP_COVER_TILT, ) -from homeassistant.const import ATTR_ENTITY_ID, STATE_OPEN, STATE_UNAVAILABLE, Platform +from homeassistant.const import ATTR_ENTITY_ID, STATE_OPEN, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -114,17 +114,6 @@ async def test_cover( ) assert aioclient_mock.mock_calls[4][2] == {"stop": True} - await hass.config_entries.async_unload(config_entry.entry_id) - - states = hass.states.async_all() - assert len(states) == 1 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "light_payload", diff --git a/tests/components/deconz/test_deconz_event.py b/tests/components/deconz/test_deconz_event.py index 77cc50ebed6..8bf7bb146d1 100644 --- a/tests/components/deconz/test_deconz_event.py +++ b/tests/components/deconz/test_deconz_event.py @@ -17,13 +17,7 @@ from homeassistant.components.deconz.deconz_event import ( CONF_DECONZ_RELATIVE_ROTARY_EVENT, RELATIVE_ROTARY_DECONZ_TO_EVENT, ) -from homeassistant.const import ( - CONF_DEVICE_ID, - CONF_EVENT, - CONF_ID, - CONF_UNIQUE_ID, - STATE_UNAVAILABLE, -) +from homeassistant.const import CONF_DEVICE_ID, CONF_EVENT, CONF_ID, CONF_UNIQUE_ID from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr @@ -166,17 +160,6 @@ async def test_deconz_events( await sensor_ws_data({"id": "1", "name": "other name"}) assert len(captured_events) == 4 - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(hass.states.async_all()) == 3 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "alarm_system_payload", @@ -336,17 +319,6 @@ async def test_deconz_alarm_events( await sensor_ws_data({"state": {"panel": AncillaryControlPanel.ARMED_AWAY}}) assert len(captured_events) == 4 - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(hass.states.async_all()) == 4 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", @@ -425,17 +397,6 @@ async def test_deconz_presence_events( await sensor_ws_data({"state": {"presenceevent": PresenceStatePresenceEvent.NINE}}) assert len(captured_events) == 0 - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(hass.states.async_all()) == 5 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", @@ -513,17 +474,6 @@ async def test_deconz_relative_rotary_events( await sensor_ws_data({"name": "123"}) assert len(captured_events) == 0 - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(hass.states.async_all()) == 1 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", diff --git a/tests/components/deconz/test_fan.py b/tests/components/deconz/test_fan.py index 9fd022e65a5..21809a138c6 100644 --- a/tests/components/deconz/test_fan.py +++ b/tests/components/deconz/test_fan.py @@ -13,13 +13,7 @@ from homeassistant.components.fan import ( SERVICE_TURN_OFF, SERVICE_TURN_ON, ) -from homeassistant.const import ( - ATTR_ENTITY_ID, - STATE_OFF, - STATE_ON, - STATE_UNAVAILABLE, - Platform, -) +from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -128,14 +122,3 @@ async def test_fans( await light_ws_data({"state": {"speed": 5}}) assert hass.states.get("fan.ceiling_fan").state == STATE_ON assert not hass.states.get("fan.ceiling_fan").attributes[ATTR_PERCENTAGE] - - await hass.config_entries.async_unload(config_entry.entry_id) - - states = hass.states.async_all() - assert len(states) == 1 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_light.py b/tests/components/deconz/test_light.py index c74005d96d4..441cb01be63 100644 --- a/tests/components/deconz/test_light.py +++ b/tests/components/deconz/test_light.py @@ -32,7 +32,6 @@ from homeassistant.const import ( ATTR_SUPPORTED_FEATURES, STATE_OFF, STATE_ON, - STATE_UNAVAILABLE, Platform, ) from homeassistant.core import HomeAssistant @@ -295,16 +294,6 @@ async def test_lights( config_entry = await config_entry_factory() await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id) - await hass.config_entries.async_unload(config_entry.entry_id) - - states = hass.states.async_all() - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "light_payload", @@ -762,16 +751,6 @@ async def test_groups( config_entry = await config_entry_factory() await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id) - await hass.config_entries.async_unload(config_entry.entry_id) - - states = hass.states.async_all() - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "light_payload", diff --git a/tests/components/deconz/test_lock.py b/tests/components/deconz/test_lock.py index 452a4685150..467b96f200e 100644 --- a/tests/components/deconz/test_lock.py +++ b/tests/components/deconz/test_lock.py @@ -9,12 +9,7 @@ from homeassistant.components.lock import ( SERVICE_LOCK, SERVICE_UNLOCK, ) -from homeassistant.const import ( - ATTR_ENTITY_ID, - STATE_LOCKED, - STATE_UNAVAILABLE, - STATE_UNLOCKED, -) +from homeassistant.const import ATTR_ENTITY_ID, STATE_LOCKED, STATE_UNLOCKED from homeassistant.core import HomeAssistant from .conftest import WebsocketDataType @@ -78,17 +73,6 @@ async def test_lock_from_light( ) assert aioclient_mock.mock_calls[2][2] == {"on": False} - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(states) == 1 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", @@ -152,14 +136,3 @@ async def test_lock_from_sensor( blocking=True, ) assert aioclient_mock.mock_calls[2][2] == {"lock": False} - - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(states) == 2 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_number.py b/tests/components/deconz/test_number.py index 66eccdc6b4c..962c2c0a89b 100644 --- a/tests/components/deconz/test_number.py +++ b/tests/components/deconz/test_number.py @@ -12,7 +12,7 @@ from homeassistant.components.number import ( DOMAIN as NUMBER_DOMAIN, SERVICE_SET_VALUE, ) -from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, Platform +from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import entity_registry as er @@ -136,14 +136,3 @@ async def test_number_entities( }, blocking=True, ) - - # Unload entry - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get(expected["entity_id"]).state == STATE_UNAVAILABLE - - # Remove entry - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_scene.py b/tests/components/deconz/test_scene.py index d3a5725f7b1..c1240b6881c 100644 --- a/tests/components/deconz/test_scene.py +++ b/tests/components/deconz/test_scene.py @@ -8,7 +8,7 @@ import pytest from syrupy import SnapshotAssertion from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON -from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, Platform +from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -64,17 +64,6 @@ async def test_scenes( ) assert aioclient_mock.mock_calls[1][2] == {} - # Unload entry - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get(expected["entity_id"]).state == STATE_UNAVAILABLE - - # Remove entry - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "group_payload", diff --git a/tests/components/deconz/test_select.py b/tests/components/deconz/test_select.py index cee133f9999..900283d88bb 100644 --- a/tests/components/deconz/test_select.py +++ b/tests/components/deconz/test_select.py @@ -16,7 +16,7 @@ from homeassistant.components.select import ( DOMAIN as SELECT_DOMAIN, SERVICE_SELECT_OPTION, ) -from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, Platform +from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -149,14 +149,3 @@ async def test_select( blocking=True, ) assert aioclient_mock.mock_calls[1][2] == expected["request_data"] - - # Unload entry - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get(expected["entity_id"]).state == STATE_UNAVAILABLE - - # Remove entry - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_sensor.py b/tests/components/deconz/test_sensor.py index b50032d9c9f..e6ae85df615 100644 --- a/tests/components/deconz/test_sensor.py +++ b/tests/components/deconz/test_sensor.py @@ -10,7 +10,7 @@ from syrupy import SnapshotAssertion from homeassistant.components.deconz.const import CONF_ALLOW_CLIP_SENSOR from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.config_entries import RELOAD_AFTER_UPDATE_DELAY -from homeassistant.const import STATE_UNAVAILABLE, Platform +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from homeassistant.util import dt as dt_util @@ -639,17 +639,6 @@ async def test_sensors( await sensor_ws_data(expected["websocket_event"]) assert hass.states.get(expected["entity_id"]).state == expected["next_state"] - # Unload entry - - await hass.config_entries.async_unload(config_entry.entry_id) - assert hass.states.get(expected["entity_id"]).state == STATE_UNAVAILABLE - - # Remove entry - - await hass.config_entries.async_remove(config_entry.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "sensor_payload", diff --git a/tests/components/deconz/test_siren.py b/tests/components/deconz/test_siren.py index 488f12cd65d..17d91a97d28 100644 --- a/tests/components/deconz/test_siren.py +++ b/tests/components/deconz/test_siren.py @@ -11,7 +11,6 @@ from homeassistant.const import ( SERVICE_TURN_ON, STATE_OFF, STATE_ON, - STATE_UNAVAILABLE, ) from homeassistant.core import HomeAssistant @@ -78,14 +77,3 @@ async def test_sirens( blocking=True, ) assert aioclient_mock.mock_calls[3][2] == {"alert": "lselect", "ontime": 100} - - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(states) == 1 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 diff --git a/tests/components/deconz/test_switch.py b/tests/components/deconz/test_switch.py index 60731162e35..c1a047c73c4 100644 --- a/tests/components/deconz/test_switch.py +++ b/tests/components/deconz/test_switch.py @@ -11,7 +11,7 @@ from homeassistant.components.switch import ( SERVICE_TURN_OFF, SERVICE_TURN_ON, ) -from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON, STATE_UNAVAILABLE +from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -92,17 +92,6 @@ async def test_power_plugs( ) assert aioclient_mock.mock_calls[2][2] == {"on": False} - await hass.config_entries.async_unload(config_entry_setup.entry_id) - - states = hass.states.async_all() - assert len(states) == 4 - for state in states: - assert state.state == STATE_UNAVAILABLE - - await hass.config_entries.async_remove(config_entry_setup.entry_id) - await hass.async_block_till_done() - assert len(hass.states.async_all()) == 0 - @pytest.mark.parametrize( "light_payload",