Improve string formatting v5 (#33697)
* Improve string formatting v5 * Address review comments
This commit is contained in:
1 parent
39336d3ea3
commit
fca90a8ddc
46 files changed
+221
-252
No files matched your search
@@ -337,21 +337,20 @@ class ZwaveLock(ZWaveDeviceEntity, LockDevice):
|
||||
)
|
||||
|
||||
if alarm_type == 21:
|
||||
self._lock_status = "{}{}".format(
|
||||
LOCK_ALARM_TYPE.get(str(alarm_type)),
|
||||
MANUAL_LOCK_ALARM_LEVEL.get(str(alarm_level)),
|
||||
self._lock_status = (
|
||||
f"{LOCK_ALARM_TYPE.get(str(alarm_type))}"
|
||||
f"{MANUAL_LOCK_ALARM_LEVEL.get(str(alarm_level))}"
|
||||
)
|
||||
return
|
||||
if str(alarm_type) in ALARM_TYPE_STD:
|
||||
self._lock_status = "{}{}".format(
|
||||
LOCK_ALARM_TYPE.get(str(alarm_type)), str(alarm_level)
|
||||
)
|
||||
self._lock_status = f"{LOCK_ALARM_TYPE.get(str(alarm_type))}{alarm_level}"
|
||||
return
|
||||
if alarm_type == 161:
|
||||
self._lock_status = "{}{}".format(
|
||||
LOCK_ALARM_TYPE.get(str(alarm_type)),
|
||||
TAMPER_ALARM_LEVEL.get(str(alarm_level)),
|
||||
self._lock_status = (
|
||||
f"{LOCK_ALARM_TYPE.get(str(alarm_type))}"
|
||||
f"{TAMPER_ALARM_LEVEL.get(str(alarm_level))}"
|
||||
)
|
||||
|
||||
return
|
||||
if alarm_type != 0:
|
||||
self._lock_status = LOCK_ALARM_TYPE.get(str(alarm_type))
|
||||
|
||||
Reference in new issue
Block a user