Skip to content

Commit c4620bc

Browse files
committed
Display a proper name for the device type
1 parent 5f1c0a0 commit c4620bc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

custom_components/nuki_web/entity.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,20 @@ def device_info(self):
2424
if not self.available:
2525
return None
2626
data = self.coordinator.data[self._smartlock_id]
27+
28+
device_type = data.get("type")
29+
device_type_name = {
30+
0: "Smart Lock", # Keyturner
31+
1: "Bridge", # Box
32+
2: "Opener",
33+
3: "Smart Door",
34+
4: "Smart Lock 3.0/4. Gen",
35+
}.get(device_type, f"Unknown ({device_type})")
36+
2737
return {
2838
"identifiers": {(DOMAIN, str(self._smartlock_id))},
2939
"name": data["name"],
3040
"manufacturer": "Nuki",
31-
"model": f"Smart Lock Type {data.get('type')}",
41+
"model": device_type_name,
3242
"sw_version": str(data.get("firmwareVersion")),
3343
}

0 commit comments

Comments
 (0)