mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 07:25:52 -05:00
Add K11+ Vacuum for switchbot integration (#152643)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user