Skip to content

Commit

Permalink
Allow selecting /dev/duofernstick in config flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Aug 21, 2023
1 parent c557c3f commit 7a7fd82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/duofern/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ async def async_step_user(self, user_input: Mapping[str, Any]|None =None) -> Flo
if os.path.isdir("/dev/"):
serialdevs.update(set(glob.glob("/dev/ttyU*")))
serialdevs.update(set(glob.glob("/dev/ttyA*")))
serialdevs.update(set(glob.glob("/dev/duofernstick")))

if len(serialdevs) == 0:
serialdevs = set(["could not find /dev/serial/by-id/ or /dev/tty{U,A}*, did you plug in your duofern stick correctly?"])
serialdevs = set(["could not find /dev/serial/by-id/, /dev/tty{U,A}* or /dev/duofernstick. Did you plug in your duofern stick correctly?"])

return self.async_show_form(
step_id='user',
Expand Down

0 comments on commit 7a7fd82

Please sign in to comment.