Skip to content

Commit

Permalink
Adding correct product names (pschmitt#86)
Browse files Browse the repository at this point in the history
* Adding correct product names

* Implementing changes

* Adding device_model_str

* Git screwup

* Fix indent
  • Loading branch information
Savjee authored Mar 1, 2023
1 parent ba90452 commit 18eb60c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pynuki/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ def device_type_str(self):
logger.error(f"Unknown device type: {dev}")
return "UNKNOWN"

@property
def device_model_str(self):
dev = self.device_type
if dev == const.DEVICE_TYPE_LOCK:
return "Nuki Smart Lock 1.0/2.0"
elif dev == const.DEVICE_TYPE_OPENER:
return "Nuki Opener"
elif dev == const.DEVICE_TYPE_SMARTDOOR:
return "Nuki Smart Door"
elif dev == const.DEVICE_TYPE_SMARTLOCK3:
return "Nuki Smart Lock 3.0 (Pro)"
logger.error(f"Unknown device type: {dev}")
return "UNKNOWN"

@property
def mode(self):
return self._json.get("mode")
Expand Down

0 comments on commit 18eb60c

Please sign in to comment.