diff --git a/homeassistant/components/switchbot/__init__.py b/homeassistant/components/switchbot/__init__.py index ce0e8412b868..fa2422923bb8 100644 --- a/homeassistant/components/switchbot/__init__.py +++ b/homeassistant/components/switchbot/__init__.py @@ -74,11 +74,12 @@ PLATFORMS_BY_TYPE = { ], SupportedModels.HUBMINI_MATTER.value: [Platform.SENSOR], SupportedModels.CIRCULATOR_FAN.value: [Platform.FAN, Platform.SENSOR], - SupportedModels.K20_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], SupportedModels.S10_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], SupportedModels.K10_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], SupportedModels.K10_PRO_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], SupportedModels.K10_PRO_COMBO_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], + SupportedModels.K11_PLUS_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], + SupportedModels.K20_VACUUM.value: [Platform.VACUUM, Platform.SENSOR], SupportedModels.HUB3.value: [Platform.SENSOR, Platform.BINARY_SENSOR], SupportedModels.LOCK_LITE.value: [ Platform.BINARY_SENSOR, @@ -115,11 +116,12 @@ CLASS_BY_DEVICE = { SupportedModels.RELAY_SWITCH_1.value: switchbot.SwitchbotRelaySwitch, SupportedModels.ROLLER_SHADE.value: switchbot.SwitchbotRollerShade, SupportedModels.CIRCULATOR_FAN.value: switchbot.SwitchbotFan, - SupportedModels.K20_VACUUM.value: switchbot.SwitchbotVacuum, SupportedModels.S10_VACUUM.value: switchbot.SwitchbotVacuum, SupportedModels.K10_VACUUM.value: switchbot.SwitchbotVacuum, SupportedModels.K10_PRO_VACUUM.value: switchbot.SwitchbotVacuum, SupportedModels.K10_PRO_COMBO_VACUUM.value: switchbot.SwitchbotVacuum, + SupportedModels.K11_PLUS_VACUUM.value: switchbot.SwitchbotVacuum, + SupportedModels.K20_VACUUM.value: switchbot.SwitchbotVacuum, SupportedModels.LOCK_LITE.value: switchbot.SwitchbotLock, SupportedModels.LOCK_ULTRA.value: switchbot.SwitchbotLock, SupportedModels.AIR_PURIFIER.value: switchbot.SwitchbotAirPurifier, diff --git a/homeassistant/components/switchbot/const.py b/homeassistant/components/switchbot/const.py index c10609299d4b..247191d9c840 100644 --- a/homeassistant/components/switchbot/const.py +++ b/homeassistant/components/switchbot/const.py @@ -55,6 +55,7 @@ class SupportedModels(StrEnum): RGBICWW_FLOOR_LAMP = "rgbicww_floor_lamp" PLUG_MINI_EU = "plug_mini_eu" RELAY_SWITCH_2PM = "relay_switch_2pm" + K11_PLUS_VACUUM = "k11+_vacuum" CONNECTABLE_SUPPORTED_MODEL_TYPES = { @@ -89,6 +90,7 @@ CONNECTABLE_SUPPORTED_MODEL_TYPES = { SwitchbotModel.RGBICWW_FLOOR_LAMP: SupportedModels.RGBICWW_FLOOR_LAMP, SwitchbotModel.PLUG_MINI_EU: SupportedModels.PLUG_MINI_EU, SwitchbotModel.RELAY_SWITCH_2PM: SupportedModels.RELAY_SWITCH_2PM, + SwitchbotModel.K11_VACUUM: SupportedModels.K11_PLUS_VACUUM, } NON_CONNECTABLE_SUPPORTED_MODEL_TYPES = { diff --git a/tests/components/switchbot/__init__.py b/tests/components/switchbot/__init__.py index 72dc62b0b096..497b3b8a07d0 100644 --- a/tests/components/switchbot/__init__.py +++ b/tests/components/switchbot/__init__.py @@ -1105,3 +1105,25 @@ RELAY_SWITCH_2PM_SERVICE_INFO = BluetoothServiceInfoBleak( connectable=True, tx_power=-127, ) + +K11_PLUS_VACUUM_SERVICE_INFO = BluetoothServiceInfoBleak( + name="K11+ Vacuum", + manufacturer_data={2409: b"\xb0\xe9\xfe\xe4\xbf\xd8\x0b\x01\x11f\x00\x16M\x15"}, + service_data={"0000fd3d-0000-1000-8000-00805f9b34fb": b"\x00\x00M\x00\x10\xfb\xa8"}, + service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"], + address="AA:BB:CC:DD:EE:FF", + rssi=-60, + source="local", + advertisement=generate_advertisement_data( + local_name="K11+ Vacuum", + manufacturer_data={2409: b"\xb0\xe9\xfe\xe4\xbf\xd8\x0b\x01\x11f\x00\x16M\x15"}, + service_data={ + "0000fd3d-0000-1000-8000-00805f9b34fb": b"\x00\x00M\x00\x10\xfb\xa8" + }, + service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"], + ), + device=generate_ble_device("AA:BB:CC:DD:EE:FF", "K11+ Vacuum"), + time=0, + connectable=True, + tx_power=-127, +) diff --git a/tests/components/switchbot/test_vacuum.py b/tests/components/switchbot/test_vacuum.py index 7822bda15db7..5cc579db99c2 100644 --- a/tests/components/switchbot/test_vacuum.py +++ b/tests/components/switchbot/test_vacuum.py @@ -18,6 +18,7 @@ from . import ( K10_POR_COMBO_VACUUM_SERVICE_INFO, K10_PRO_VACUUM_SERVICE_INFO, K10_VACUUM_SERVICE_INFO, + K11_PLUS_VACUUM_SERVICE_INFO, K20_VACUUM_SERVICE_INFO, S10_VACUUM_SERVICE_INFO, ) @@ -34,6 +35,7 @@ from tests.components.bluetooth import inject_bluetooth_service_info ("k10_pro_combo_vacumm", K10_POR_COMBO_VACUUM_SERVICE_INFO), ("k10_vacuum", K10_VACUUM_SERVICE_INFO), ("k10_pro_vacuum", K10_PRO_VACUUM_SERVICE_INFO), + ("k11+_vacuum", K11_PLUS_VACUUM_SERVICE_INFO), ], ) @pytest.mark.parametrize(