diff --git a/homeassistant/components/home_connect/api.py b/homeassistant/components/home_connect/api.py index d0464968d4e..10dc2d360fa 100644 --- a/homeassistant/components/home_connect/api.py +++ b/homeassistant/components/home_connect/api.py @@ -74,6 +74,8 @@ class ConfigEntryAuth(homeconnect.HomeConnectAPI): device = Dryer(self.hass, app) elif app.type == "Washer": device = Washer(self.hass, app) + elif app.type == "WasherDryer": + device = WasherDryer(self.hass, app) elif app.type == "Dishwasher": device = Dishwasher(self.hass, app) elif app.type == "FridgeFreezer": @@ -358,6 +360,30 @@ class Washer( } +class WasherDryer( + DeviceWithDoor, + DeviceWithOpState, + DeviceWithPrograms, + DeviceWithRemoteControl, + DeviceWithRemoteStart, +): + """WasherDryer class.""" + + def get_entity_info(self): + """Get a dictionary with infos about the associated entities.""" + door_entity = self.get_door_entity() + remote_control = self.get_remote_control() + remote_start = self.get_remote_start() + op_state_sensor = self.get_opstate_sensor() + program_sensors = self.get_program_sensors() + program_switches = self.get_program_switches() + return { + "binary_sensor": [door_entity, remote_control, remote_start], + "switch": program_switches, + "sensor": program_sensors + op_state_sensor, + } + + class CoffeeMaker(DeviceWithOpState, DeviceWithPrograms, DeviceWithRemoteStart): """Coffee maker class.""" diff --git a/homeassistant/components/home_connect/switch.py b/homeassistant/components/home_connect/switch.py index 89b1f23589f..61dd11dbc6f 100644 --- a/homeassistant/components/home_connect/switch.py +++ b/homeassistant/components/home_connect/switch.py @@ -50,6 +50,10 @@ class HomeConnectProgramSwitch(HomeConnectEntity, SwitchEntity): def __init__(self, device, program_name): """Initialize the entity.""" desc = " ".join(["Program", program_name.split(".")[-1]]) + if device.appliance.type == "WasherDryer": + desc = " ".join( + ["Program", program_name.split(".")[-3], program_name.split(".")[-1]] + ) super().__init__(device, desc) self.program_name = program_name self._state = None