Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlarmDecoder config flow fixes #40037

Merged
merged 12 commits into from
Sep 15, 2020
Prev Previous commit
consolidate executor fns
  • Loading branch information
ajschmidt8 committed Sep 15, 2020
commit 5d9484f90335241d50f22a5a380dccf7e68a4cb5
8 changes: 6 additions & 2 deletions homeassistant/components/alarmdecoder/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ async def async_step_protocol(self, user_input=None):
device = SerialDevice(interface=path)

controller = AdExt(device)

def test_connection():
controller.open(baud)
controller.close()

try:
await self.hass.async_add_executor_job(controller.open, baud)
await self.hass.async_add_executor_job(controller.close)
await self.hass.async_add_executor_job(test_connection)
return self.async_create_entry(
title=title, data={CONF_PROTOCOL: self.protocol, **connection}
)
Expand Down