mirror of
https://github.com/JoelBender/bacpypes
synced 2025-09-28 22:15:23 +08:00
Most minimial change to Enumerated.is_valid which will throw exception
when value is invalid
This commit is contained in:
parent
a5be2ad5ac
commit
b405ecd508
|
@ -1255,6 +1255,7 @@ class Enumerated(Atomic):
|
||||||
"""Return True if arg is valid value for the class. If the string
|
"""Return True if arg is valid value for the class. If the string
|
||||||
value is wrong for the enumeration, the encoding will fail.
|
value is wrong for the enumeration, the encoding will fail.
|
||||||
"""
|
"""
|
||||||
|
cls(arg)
|
||||||
return (isinstance(arg, int) and (arg >= 0)) or \
|
return (isinstance(arg, int) and (arg >= 0)) or \
|
||||||
isinstance(arg, str)
|
isinstance(arg, str)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user