diff --git a/homeassistant/components/tplink/manifest.json b/homeassistant/components/tplink/manifest.json index a975e675ceb..f55dfda1664 100644 --- a/homeassistant/components/tplink/manifest.json +++ b/homeassistant/components/tplink/manifest.json @@ -300,5 +300,5 @@ "documentation": "https://www.home-assistant.io/integrations/tplink", "iot_class": "local_polling", "loggers": ["kasa"], - "requirements": ["python-kasa[speedups]==0.9.1"] + "requirements": ["python-kasa[speedups]==0.10.0"] } diff --git a/homeassistant/components/tplink/siren.py b/homeassistant/components/tplink/siren.py index 5931a508d6c..d1ce03c1469 100644 --- a/homeassistant/components/tplink/siren.py +++ b/homeassistant/components/tplink/siren.py @@ -7,7 +7,6 @@ from dataclasses import dataclass from typing import Any from kasa import Device, Module -from kasa.smart.modules.alarm import Alarm from homeassistant.components.siren import ( DOMAIN as SIREN_DOMAIN, @@ -101,7 +100,7 @@ class TPLinkSirenEntity(CoordinatedTPLinkModuleEntity, SirenEntity): ) -> None: """Initialize the siren entity.""" super().__init__(device, coordinator, description, parent=parent) - self._alarm_module: Alarm = device.modules[Module.Alarm] + self._alarm_module = device.modules[Module.Alarm] @async_refresh_after async def async_turn_on(self, **kwargs: Any) -> None: diff --git a/requirements_all.txt b/requirements_all.txt index c687944081f..c1148cc3b6b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2396,7 +2396,7 @@ python-join-api==0.0.9 python-juicenet==1.1.0 # homeassistant.components.tplink -python-kasa[speedups]==0.9.1 +python-kasa[speedups]==0.10.0 # homeassistant.components.linkplay python-linkplay==0.1.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 69b6912ec56..3c946d89857 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1935,7 +1935,7 @@ python-izone==1.2.9 python-juicenet==1.1.0 # homeassistant.components.tplink -python-kasa[speedups]==0.9.1 +python-kasa[speedups]==0.10.0 # homeassistant.components.linkplay python-linkplay==0.1.3 diff --git a/tests/components/tplink/const.py b/tests/components/tplink/const.py index 57829a7aa34..54aab1e2f3c 100644 --- a/tests/components/tplink/const.py +++ b/tests/components/tplink/const.py @@ -55,7 +55,6 @@ DEVICE_CONFIG_KLAP = DeviceConfig( IP_ADDRESS, credentials=CREDENTIALS, connection_type=CONN_PARAMS_KLAP, - uses_http=True, ) CONN_PARAMS_AES = DeviceConnectionParameters( DeviceFamily.SmartTapoPlug, DeviceEncryptionType.Aes @@ -84,7 +83,6 @@ DEVICE_CONFIG_AES = DeviceConfig( IP_ADDRESS2, credentials=CREDENTIALS, connection_type=CONN_PARAMS_AES, - uses_http=True, aes_keys=AES_KEYS, ) CONN_PARAMS_AES_CAMERA = DeviceConnectionParameters( @@ -94,7 +92,6 @@ DEVICE_CONFIG_AES_CAMERA = DeviceConfig( IP_ADDRESS3, credentials=CREDENTIALS, connection_type=CONN_PARAMS_AES_CAMERA, - uses_http=True, ) DEVICE_CONFIG_DICT_KLAP = { diff --git a/tests/components/tplink/test_config_flow.py b/tests/components/tplink/test_config_flow.py index b093847869e..35fd4f418de 100644 --- a/tests/components/tplink/test_config_flow.py +++ b/tests/components/tplink/test_config_flow.py @@ -1169,7 +1169,6 @@ async def test_manual_port_override( host, credentials=None, port_override=port, - uses_http=True, connection_type=CONN_PARAMS_KLAP, ) mock_device = _mocked_device( @@ -1491,7 +1490,6 @@ async def test_integration_discovery_with_ip_change( # Check that init set the new host correctly before calling connect assert config.host == IP_ADDRESS config.host = IP_ADDRESS2 - config.uses_http = False # Not passed in to new config class config.http_client = "Foo" mock_connect["connect"].assert_awaited_once_with(config=config) @@ -1578,7 +1576,6 @@ async def test_integration_discovery_with_connection_change( assert mock_config_entry.state is ConfigEntryState.LOADED config.host = IP_ADDRESS2 - config.uses_http = False # Not passed in to new config class config.http_client = "Foo" config.aes_keys = AES_KEYS mock_connect["connect"].assert_awaited_once_with(config=config) @@ -1847,7 +1844,6 @@ async def test_reauth_update_with_encryption_change( connection_type=Device.ConnectionParameters( Device.Family.SmartTapoPlug, Device.EncryptionType.Klap ), - uses_http=True, ) mock_device = _mocked_device( alias="my_device", diff --git a/tests/components/tplink/test_init.py b/tests/components/tplink/test_init.py index ffcadc79faf..972ca73c45c 100644 --- a/tests/components/tplink/test_init.py +++ b/tests/components/tplink/test_init.py @@ -246,7 +246,6 @@ async def test_config_entry_with_stored_credentials( await hass.async_block_till_done() assert mock_config_entry.state is ConfigEntryState.LOADED config = DeviceConfig.from_dict(DEVICE_CONFIG_KLAP.to_dict()) - config.uses_http = False config.http_client = "Foo" assert config.credentials != stored_credentials config.credentials = stored_credentials @@ -762,7 +761,6 @@ async def test_credentials_hash_auth_error( expected_config = DeviceConfig.from_dict( {**DEVICE_CONFIG_DICT_KLAP, "credentials_hash": "theHash"} ) - expected_config.uses_http = False expected_config.http_client = "Foo" connect_mock.assert_called_with(config=expected_config) assert entry.state is ConfigEntryState.SETUP_ERROR @@ -794,13 +792,20 @@ async def test_migrate_remove_device_config( As async_setup_entry will succeed the hash on the parent is updated from the device. """ + old_device_config = { + k: v for k, v in device_config.to_dict().items() if k != "credentials" + } + device_config_dict = { + **old_device_config, + "uses_http": device_config.connection_type.encryption_type + is not Device.EncryptionType.Xor, + } + OLD_CREATE_ENTRY_DATA = { CONF_HOST: expected_entry_data[CONF_HOST], CONF_ALIAS: ALIAS, CONF_MODEL: MODEL, - CONF_DEVICE_CONFIG: { - k: v for k, v in device_config.to_dict().items() if k != "credentials" - }, + CONF_DEVICE_CONFIG: device_config_dict, } entry = MockConfigEntry(