Skip to content

Commit

Permalink
Finish up migration for YAML config into Config Entries. Fixes #134
Browse files Browse the repository at this point in the history
  • Loading branch information
sebr committed Jul 3, 2022
1 parent 5f20977 commit ff99e5f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions custom_components/bhyve/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,9 @@ async def async_step_import(self, config):
self.devices = await self.client.devices # type: ignore[union-attr]
self.programs = await self.client.timer_programs # type: ignore[union-attr]

devices = {
str(d["id"]): f'{d["name"]}'
for d in self.devices
if d["type"] != DEVICE_BRIDGE
}

import_input = {CONF_DEVICES: devices}
devices = [str(d["id"]) for d in self.devices if d["type"] != DEVICE_BRIDGE]

return await self.async_step_device(user_input=import_input)
return await self.async_step_device(user_input={CONF_DEVICES: devices})
else:
return self.async_abort(reason="cannot_connect")

Expand Down Expand Up @@ -213,8 +207,8 @@ async def async_step_init(self, user_input=None):
# _LOGGER.debug("Devices: %s", json.dumps(devices))
# _LOGGER.debug("Programs: %s", json.dumps(programs))

_LOGGER.debug("ALL DEVICES")
_LOGGER.debug(self.config_entry.options.get(CONF_DEVICES))
# _LOGGER.debug("ALL DEVICES")
# _LOGGER.debug(str(self.config_entry.options))

device_options = {
str(d["id"]): f'{d["name"]}' for d in devices if d["type"] != DEVICE_BRIDGE
Expand Down

0 comments on commit ff99e5f

Please sign in to comment.