move get_type_by_bt_name into lib

This commit is contained in:
Patrick762 committed 2024-02-18 14:35:16 +01:00
1 parent caac9330b4
commit 564a971d7c
4 files changed
+10 -24

No files matched your search

@@ -37,3 +37,10 @@ def build_device(address: str, name: str):
return EP600(address, match[2])
if match[1] == "EP760":
return EP760(address, match[2])
def get_type_by_bt_name(bt_name: str):
match = DEVICE_NAME_RE.match(bt_name)
if len(match) > 0:
return match[1]
return "Unknown"