Skip to content

Commit 5f9b098

Browse files
authored
Add K11+ vacuum support to Switchbot Cloud (home-assistant#154363)
1 parent 143f7df commit 5f9b098

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

homeassistant/components/switchbot_cloud/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ async def make_device_data(
158158
"Robot Vacuum Cleaner K10+ Pro Combo",
159159
"Robot Vacuum Cleaner S10",
160160
"S20",
161+
"Robot Vacuum Cleaner K11 Plus",
161162
]:
162163
coordinator = await coordinator_for_device(
163164
hass, entry, api, device, coordinators_by_id, True

homeassistant/components/switchbot_cloud/vacuum.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def _set_attributes(self) -> None:
129129
self._attr_fan_speed = VACUUM_FAN_SPEED_QUIET
130130

131131

132-
class SwitchBotCloudVacuumK20PlusPro(SwitchBotCloudVacuum):
133-
"""Representation of a SwitchBot K20+ Pro."""
132+
class SwitchBotCloudVacuumV2(SwitchBotCloudVacuum):
133+
"""Representation of a SwitchBot K20+ Pro & Robot Vacuum Cleaner K11 Plus."""
134134

135135
async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
136136
"""Set fan speed."""
@@ -176,7 +176,7 @@ async def async_start(self) -> None:
176176
await self.coordinator.async_request_refresh()
177177

178178

179-
class SwitchBotCloudVacuumK10PlusProCombo(SwitchBotCloudVacuumK20PlusPro):
179+
class SwitchBotCloudVacuumK10PlusProCombo(SwitchBotCloudVacuumV2):
180180
"""Representation of a SwitchBot vacuum K10+ Pro Combo."""
181181

182182
async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
@@ -194,7 +194,7 @@ async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
194194
await self.coordinator.async_request_refresh()
195195

196196

197-
class SwitchBotCloudVacuumV3(SwitchBotCloudVacuumK20PlusPro):
197+
class SwitchBotCloudVacuumV3(SwitchBotCloudVacuumV2):
198198
"""Representation of a SwitchBot vacuum Robot Vacuum Cleaner S10 & S20."""
199199

200200
async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
@@ -236,16 +236,15 @@ def _async_make_entity(
236236
api: SwitchBotAPI, device: Device | Remote, coordinator: SwitchBotCoordinator
237237
) -> (
238238
SwitchBotCloudVacuum
239-
| SwitchBotCloudVacuumK20PlusPro
239+
| SwitchBotCloudVacuumV2
240240
| SwitchBotCloudVacuumV3
241241
| SwitchBotCloudVacuumK10PlusProCombo
242242
):
243243
"""Make a SwitchBotCloudVacuum."""
244-
if device.device_type in VacuumCleanerV2Commands.get_supported_devices():
245-
if device.device_type == "K20+ Pro":
246-
return SwitchBotCloudVacuumK20PlusPro(api, device, coordinator)
244+
if device.device_type in ["K20+ Pro", "Robot Vacuum Cleaner K11 Plus"]:
245+
return SwitchBotCloudVacuumV2(api, device, coordinator)
246+
if device.device_type == "Robot Vacuum Cleaner K10+ Pro Combo":
247247
return SwitchBotCloudVacuumK10PlusProCombo(api, device, coordinator)
248-
249248
if device.device_type in VacuumCleanerV3Commands.get_supported_devices():
250249
return SwitchBotCloudVacuumV3(api, device, coordinator)
251250
return SwitchBotCloudVacuum(api, device, coordinator)

0 commit comments

Comments
 (0)