mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Display only supported Home Connect appliance programs (#88801)
Show only supported device programs
This commit is contained in:
parent
586471b5a9
commit
dc05272120
@ -145,11 +145,14 @@ class HomeConnectDevice:
|
|||||||
class DeviceWithPrograms(HomeConnectDevice):
|
class DeviceWithPrograms(HomeConnectDevice):
|
||||||
"""Device with programs."""
|
"""Device with programs."""
|
||||||
|
|
||||||
PROGRAMS: list[dict[str, str]] = []
|
|
||||||
|
|
||||||
def get_programs_available(self):
|
def get_programs_available(self):
|
||||||
"""Get the available programs."""
|
"""Get the available programs."""
|
||||||
return self.PROGRAMS
|
try:
|
||||||
|
programs_available = self.appliance.get_programs_available()
|
||||||
|
except (HomeConnectError, ValueError):
|
||||||
|
_LOGGER.debug("Unable to fetch available programs. Probably offline")
|
||||||
|
programs_available = None
|
||||||
|
return programs_available
|
||||||
|
|
||||||
def get_program_switches(self):
|
def get_program_switches(self):
|
||||||
"""Get a dictionary with info about program switches.
|
"""Get a dictionary with info about program switches.
|
||||||
@ -157,7 +160,7 @@ class DeviceWithPrograms(HomeConnectDevice):
|
|||||||
There will be one switch for each program.
|
There will be one switch for each program.
|
||||||
"""
|
"""
|
||||||
programs = self.get_programs_available()
|
programs = self.get_programs_available()
|
||||||
return [{ATTR_DEVICE: self, "program_name": p["name"]} for p in programs]
|
return [{ATTR_DEVICE: self, "program_name": p} for p in programs]
|
||||||
|
|
||||||
def get_program_sensors(self):
|
def get_program_sensors(self):
|
||||||
"""Get a dictionary with info about program sensors.
|
"""Get a dictionary with info about program sensors.
|
||||||
@ -265,27 +268,6 @@ class Dryer(
|
|||||||
):
|
):
|
||||||
"""Dryer class."""
|
"""Dryer class."""
|
||||||
|
|
||||||
PROGRAMS = [
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Cotton"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Synthetic"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Mix"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Blankets"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.BusinessShirts"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.DownFeathers"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Hygiene"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Jeans"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Outdoor"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.SyntheticRefresh"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Towels"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Delicates"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Super40"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Shirts15"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.Pillow"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.AntiShrink"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.TimeCold"},
|
|
||||||
{"name": "LaundryCare.Dryer.Program.TimeWarm"},
|
|
||||||
]
|
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
"""Get a dictionary with infos about the associated entities."""
|
"""Get a dictionary with infos about the associated entities."""
|
||||||
door_entity = self.get_door_entity()
|
door_entity = self.get_door_entity()
|
||||||
@ -311,32 +293,6 @@ class Dishwasher(
|
|||||||
):
|
):
|
||||||
"""Dishwasher class."""
|
"""Dishwasher class."""
|
||||||
|
|
||||||
PROGRAMS = [
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Auto1"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Auto2"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Auto3"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Eco50"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Quick45"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Intensiv70"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Normal65"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Glas40"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.GlassCare"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.PreRinse"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.NightWash"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Quick65"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Normal45"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Intensiv45"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.AutoHalfLoad"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.IntensivPower"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.MagicDaily"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Super60"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.Kurz60"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.ExpressSparkle65"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.MachineCare"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.SteamFresh"},
|
|
||||||
{"name": "Dishcare.Dishwasher.Program.MaximumCleaning"},
|
|
||||||
]
|
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
"""Get a dictionary with infos about the associated entities."""
|
"""Get a dictionary with infos about the associated entities."""
|
||||||
door_entity = self.get_door_entity()
|
door_entity = self.get_door_entity()
|
||||||
@ -361,14 +317,6 @@ class Oven(
|
|||||||
):
|
):
|
||||||
"""Oven class."""
|
"""Oven class."""
|
||||||
|
|
||||||
PROGRAMS = [
|
|
||||||
{"name": "Cooking.Oven.Program.HeatingMode.PreHeating"},
|
|
||||||
{"name": "Cooking.Oven.Program.HeatingMode.HotAir"},
|
|
||||||
{"name": "Cooking.Oven.Program.HeatingMode.TopBottomHeating"},
|
|
||||||
{"name": "Cooking.Oven.Program.HeatingMode.PizzaSetting"},
|
|
||||||
{"name": "Cooking.Oven.Program.Microwave.600Watt"},
|
|
||||||
]
|
|
||||||
|
|
||||||
power_off_state = BSH_POWER_STANDBY
|
power_off_state = BSH_POWER_STANDBY
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
@ -395,30 +343,6 @@ class Washer(
|
|||||||
):
|
):
|
||||||
"""Washer class."""
|
"""Washer class."""
|
||||||
|
|
||||||
PROGRAMS = [
|
|
||||||
{"name": "LaundryCare.Washer.Program.Cotton"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Cotton.CottonEco"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.EasyCare"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Mix"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.DelicatesSilk"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Wool"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Sensitive"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Auto30"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Auto40"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Auto60"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Chiffon"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Curtains"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.DarkWash"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Dessous"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Monsoon"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Outdoor"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.PlushToy"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.ShirtsBlouses"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.SportFitness"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.Towels"},
|
|
||||||
{"name": "LaundryCare.Washer.Program.WaterProof"},
|
|
||||||
]
|
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
"""Get a dictionary with infos about the associated entities."""
|
"""Get a dictionary with infos about the associated entities."""
|
||||||
door_entity = self.get_door_entity()
|
door_entity = self.get_door_entity()
|
||||||
@ -437,23 +361,6 @@ class Washer(
|
|||||||
class CoffeeMaker(DeviceWithOpState, DeviceWithPrograms, DeviceWithRemoteStart):
|
class CoffeeMaker(DeviceWithOpState, DeviceWithPrograms, DeviceWithRemoteStart):
|
||||||
"""Coffee maker class."""
|
"""Coffee maker class."""
|
||||||
|
|
||||||
PROGRAMS = [
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.Espresso"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.EspressoMacchiato"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.Coffee"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.Cappuccino"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.LatteMacchiato"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.CaffeLatte"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.CoffeeWorld.Americano"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.EspressoDoppio"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.CoffeeWorld.FlatWhite"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.CoffeeWorld.Galao"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.MilkFroth"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.WarmMilk"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.Beverage.Ristretto"},
|
|
||||||
{"name": "ConsumerProducts.CoffeeMaker.Program.CoffeeWorld.Cortado"},
|
|
||||||
]
|
|
||||||
|
|
||||||
power_off_state = BSH_POWER_STANDBY
|
power_off_state = BSH_POWER_STANDBY
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
@ -479,12 +386,6 @@ class Hood(
|
|||||||
):
|
):
|
||||||
"""Hood class."""
|
"""Hood class."""
|
||||||
|
|
||||||
PROGRAMS = [
|
|
||||||
{"name": "Cooking.Common.Program.Hood.Automatic"},
|
|
||||||
{"name": "Cooking.Common.Program.Hood.Venting"},
|
|
||||||
{"name": "Cooking.Common.Program.Hood.DelayedShutOff"},
|
|
||||||
]
|
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
"""Get a dictionary with infos about the associated entities."""
|
"""Get a dictionary with infos about the associated entities."""
|
||||||
remote_control = self.get_remote_control()
|
remote_control = self.get_remote_control()
|
||||||
@ -532,8 +433,6 @@ class Freezer(DeviceWithDoor):
|
|||||||
class Hob(DeviceWithOpState, DeviceWithPrograms, DeviceWithRemoteControl):
|
class Hob(DeviceWithOpState, DeviceWithPrograms, DeviceWithRemoteControl):
|
||||||
"""Hob class."""
|
"""Hob class."""
|
||||||
|
|
||||||
PROGRAMS = [{"name": "Cooking.Hob.Program.PowerLevelMode"}]
|
|
||||||
|
|
||||||
def get_entity_info(self):
|
def get_entity_info(self):
|
||||||
"""Get a dictionary with infos about the associated entities."""
|
"""Get a dictionary with infos about the associated entities."""
|
||||||
remote_control = self.get_remote_control()
|
remote_control = self.get_remote_control()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user