Fix home connect coffe-milk ratio option (#138593)

* Fix home connect milk ratio option

* Use enumeration instead of number selector for coffee-milk ratio
pull/138619/head
J. Diego Rodríguez Royo 2025-02-15 20:10:27 +01:00 committed by GitHub
parent 482df7408a
commit 78c4d815ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 66 additions and 9 deletions

View File

@ -76,7 +76,6 @@ PROGRAM_OPTIONS = {
for key, value in {
OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_FILL_QUANTITY: int,
OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_MULTIPLE_BEVERAGES: bool,
OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_COFFEE_MILK_RATIO: int,
OptionKey.DISHCARE_DISHWASHER_INTENSIV_ZONE: bool,
OptionKey.DISHCARE_DISHWASHER_BRILLIANCE_DRY: bool,
OptionKey.DISHCARE_DISHWASHER_VARIO_SPEED_PLUS: bool,

View File

@ -157,6 +157,27 @@ FLOW_RATE_OPTIONS = {
)
}
COFFEE_MILK_RATIO_OPTIONS = {
bsh_key_to_translation_key(option): option
for option in (
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.10Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.20Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.25Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.30Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.40Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.50Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.55Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.60Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.65Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.67Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.70Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.75Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.80Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.85Percent",
"ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.90Percent",
)
}
HOT_WATER_TEMPERATURE_OPTIONS = {
bsh_key_to_translation_key(option): option
for option in (
@ -300,6 +321,10 @@ PROGRAM_ENUM_OPTIONS = {
BEAN_CONTAINER_OPTIONS,
),
(OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_FLOW_RATE, FLOW_RATE_OPTIONS),
(
OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_COFFEE_MILK_RATIO,
COFFEE_MILK_RATIO_OPTIONS,
),
(
OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_HOT_WATER_TEMPERATURE,
HOT_WATER_TEMPERATURE_OPTIONS,

View File

@ -328,14 +328,28 @@ set_program_and_options:
selector:
boolean:
consumer_products_coffee_maker_option_coffee_milk_ratio:
example: 50
example: consumer_products_coffee_maker_enum_type_coffee_milk_ratio_50_percent
required: false
selector:
number:
unit_of_measurement: "%"
step: 10
min: 10
max: 90
select:
mode: dropdown
translation_key: coffee_milk_ratio
options:
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_10_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_20_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_25_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_30_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_40_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_50_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_55_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_60_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_65_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_67_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_70_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_75_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_80_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_85_percent
- consumer_products_coffee_maker_enum_type_coffee_milk_ratio_90_percent
consumer_products_coffee_maker_option_hot_water_temperature:
example: consumer_products_coffee_maker_enum_type_hot_water_temperature_50_c
required: false

View File

@ -344,6 +344,25 @@
"consumer_products_coffee_maker_enum_type_flow_rate_intense_plus": "Intense plus"
}
},
"coffee_milk_ratio": {
"options": {
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_10_percent": "10%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_20_percent": "20%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_25_percent": "25%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_30_percent": "30%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_40_percent": "40%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_50_percent": "50%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_55_percent": "55%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_60_percent": "60%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_65_percent": "65%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_67_percent": "67%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_70_percent": "70%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_75_percent": "75%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_80_percent": "80%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_85_percent": "85%",
"consumer_products_coffee_maker_enum_type_coffee_milk_ratio_90_percent": "90%"
}
},
"hot_water_temperature": {
"options": {
"consumer_products_coffee_maker_enum_type_hot_water_temperature_white_tea": "White tea",

View File

@ -50,7 +50,7 @@
'key': <OptionKey.CONSUMER_PRODUCTS_COFFEE_MAKER_COFFEE_MILK_RATIO: 'ConsumerProducts.CoffeeMaker.Option.CoffeeMilkRatio'>,
'name': None,
'unit': None,
'value': 60,
'value': 'ConsumerProducts.CoffeeMaker.EnumType.CoffeeMilkRatio.50Percent',
}),
]),
}),

View File

@ -173,7 +173,7 @@ SERVICES_SET_PROGRAM_AND_OPTIONS = [
"service_data": {
"device_id": "DEVICE_ID",
"affects_to": "active_program",
"consumer_products_coffee_maker_option_coffee_milk_ratio": 60,
"consumer_products_coffee_maker_option_coffee_milk_ratio": "consumer_products_coffee_maker_enum_type_coffee_milk_ratio_50_percent",
},
"blocking": True,
},