mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Home Connect add WasherDryer support (#90673)
This commit is contained in:
parent
cd52e05075
commit
9317ddb1c7
@ -74,6 +74,8 @@ class ConfigEntryAuth(homeconnect.HomeConnectAPI):
|
|||||||
device = Dryer(self.hass, app)
|
device = Dryer(self.hass, app)
|
||||||
elif app.type == "Washer":
|
elif app.type == "Washer":
|
||||||
device = Washer(self.hass, app)
|
device = Washer(self.hass, app)
|
||||||
|
elif app.type == "WasherDryer":
|
||||||
|
device = WasherDryer(self.hass, app)
|
||||||
elif app.type == "Dishwasher":
|
elif app.type == "Dishwasher":
|
||||||
device = Dishwasher(self.hass, app)
|
device = Dishwasher(self.hass, app)
|
||||||
elif app.type == "FridgeFreezer":
|
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):
|
class CoffeeMaker(DeviceWithOpState, DeviceWithPrograms, DeviceWithRemoteStart):
|
||||||
"""Coffee maker class."""
|
"""Coffee maker class."""
|
||||||
|
|
||||||
|
@ -50,6 +50,10 @@ class HomeConnectProgramSwitch(HomeConnectEntity, SwitchEntity):
|
|||||||
def __init__(self, device, program_name):
|
def __init__(self, device, program_name):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
desc = " ".join(["Program", program_name.split(".")[-1]])
|
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)
|
super().__init__(device, desc)
|
||||||
self.program_name = program_name
|
self.program_name = program_name
|
||||||
self._state = None
|
self._state = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user