mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
🐛 Fix "The request content was malformed" error in home_connect (#76411)
This commit is contained in:
parent
64898af58e
commit
1557a7c36d
@ -138,11 +138,18 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Execute calls to services taking a program."""
|
||||
program = call.data[ATTR_PROGRAM]
|
||||
device_id = call.data[ATTR_DEVICE_ID]
|
||||
options = {
|
||||
ATTR_KEY: call.data.get(ATTR_KEY),
|
||||
ATTR_VALUE: call.data.get(ATTR_VALUE),
|
||||
ATTR_UNIT: call.data.get(ATTR_UNIT),
|
||||
}
|
||||
|
||||
options = []
|
||||
|
||||
option_key = call.data.get(ATTR_KEY)
|
||||
if option_key is not None:
|
||||
option = {ATTR_KEY: option_key, ATTR_VALUE: call.data[ATTR_VALUE]}
|
||||
|
||||
option_unit = call.data.get(ATTR_UNIT)
|
||||
if option_unit is not None:
|
||||
option[ATTR_UNIT] = option_unit
|
||||
|
||||
options.append(option)
|
||||
|
||||
appliance = _get_appliance_by_device_id(hass, device_id)
|
||||
await hass.async_add_executor_job(getattr(appliance, method), program, options)
|
||||
|
Loading…
x
Reference in New Issue
Block a user