added more models
This commit is contained in:
1 parent
84ef34d01d
commit
1b34ac7f45
3 files changed
+24
-1
No files matched your search
@@ -37,6 +37,7 @@ def device_info(entry: ConfigEntry) -> DeviceInfo:
|
||||
identifiers={(DOMAIN, entry.data.get(CONF_ADDRESS))},
|
||||
name=entry.title,
|
||||
manufacturer=MANUFACTURER,
|
||||
model=get_type_by_bt_name(entry.title),
|
||||
)
|
||||
|
||||
|
||||
@@ -46,3 +47,23 @@ def get_unique_id(name: str, sensor_type: str | None = None):
|
||||
if sensor_type is not None:
|
||||
return f"{sensor_type}.{res}"
|
||||
return res
|
||||
|
||||
|
||||
def get_type_by_bt_name(bt_name: str):
|
||||
"""Get the device type."""
|
||||
dev_type = "Unknown"
|
||||
if bt_name.startswith("AC200M"):
|
||||
dev_type = "AC200M"
|
||||
elif bt_name.startswith("AC300"):
|
||||
dev_type = "AC300"
|
||||
elif bt_name.startswith("AC500"):
|
||||
dev_type = "AC500"
|
||||
elif bt_name.startswith("AC60"):
|
||||
dev_type = "AC60"
|
||||
elif bt_name.startswith("EB3A"):
|
||||
dev_type = "EB3A"
|
||||
elif bt_name.startswith("EP500"):
|
||||
dev_type = "EP500"
|
||||
elif bt_name.startswith("EP600"):
|
||||
dev_type = "EP600"
|
||||
return dev_type
|
||||
Reference in new issue
Block a user