Fix homeworks import flow (#115761)

pull/116045/head
Erik Montnemery 2024-04-17 15:00:10 +02:00 committed by Franck Nijhof
parent db31a526e5
commit c4b504ce39
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 2 additions and 40 deletions

View File

@ -565,15 +565,7 @@ class HomeworksConfigFlowHandler(ConfigFlow, domain=DOMAIN):
CONF_KEYPADS: [
{
CONF_ADDR: keypad[CONF_ADDR],
CONF_BUTTONS: [
{
CONF_LED: button[CONF_LED],
CONF_NAME: button[CONF_NAME],
CONF_NUMBER: button[CONF_NUMBER],
CONF_RELEASE_DELAY: button[CONF_RELEASE_DELAY],
}
for button in keypad[CONF_BUTTONS]
],
CONF_BUTTONS: [],
CONF_NAME: keypad[CONF_NAME],
}
for keypad in config[CONF_KEYPADS]

View File

@ -9,7 +9,6 @@ from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAI
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN
from homeassistant.components.homeworks.const import (
CONF_ADDR,
CONF_BUTTONS,
CONF_DIMMERS,
CONF_INDEX,
CONF_KEYPADS,
@ -161,26 +160,6 @@ async def test_import_flow(
{
CONF_ADDR: "[02:08:02:01]",
CONF_NAME: "Foyer Keypad",
CONF_BUTTONS: [
{
CONF_NAME: "Morning",
CONF_NUMBER: 1,
CONF_LED: True,
CONF_RELEASE_DELAY: None,
},
{
CONF_NAME: "Relax",
CONF_NUMBER: 2,
CONF_LED: True,
CONF_RELEASE_DELAY: None,
},
{
CONF_NAME: "Dim up",
CONF_NUMBER: 3,
CONF_LED: False,
CONF_RELEASE_DELAY: 0.2,
},
],
}
],
},
@ -207,16 +186,7 @@ async def test_import_flow(
"keypads": [
{
"addr": "[02:08:02:01]",
"buttons": [
{
"led": True,
"name": "Morning",
"number": 1,
"release_delay": None,
},
{"led": True, "name": "Relax", "number": 2, "release_delay": None},
{"led": False, "name": "Dim up", "number": 3, "release_delay": 0.2},
],
"buttons": [],
"name": "Foyer Keypad",
}
],