move get_type_by_bt_name into lib
This commit is contained in:
1 parent
caac9330b4
commit
564a971d7c
4 files changed
+10
-24
No files matched your search
@@ -1,6 +1,5 @@
|
||||
"""Field attributes for device fields."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum, auto, unique
|
||||
|
||||
from .field_enums import (
|
||||
|
||||
@@ -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"
|
||||
Reference in new issue
Block a user