frappy_psi.sea: fix case when bool is implemented as text
introduce SeaBool for this Change-Id: I9c6b6ee7d33f11b173d612efc044fce8a563f626
This commit is contained in:
parent
6da671df62
commit
a7a846dfba
@ -419,11 +419,24 @@ class SeaConfigCreator(SeaClient):
|
|||||||
return reply
|
return reply
|
||||||
|
|
||||||
|
|
||||||
|
class SeaBool(BoolType):
|
||||||
|
"""some sea enum nodes used as boolean have text type -> accept '<integer>' also"""
|
||||||
|
def copy(self):
|
||||||
|
return SeaBool()
|
||||||
|
|
||||||
|
def __call__(self, value):
|
||||||
|
try:
|
||||||
|
value = int(value)
|
||||||
|
return super().__call__(value)
|
||||||
|
except Exception as e:
|
||||||
|
raise ReadFailedError(e) from e
|
||||||
|
|
||||||
|
|
||||||
SEA_TO_SECOPTYPE = {
|
SEA_TO_SECOPTYPE = {
|
||||||
'float': FloatRange(),
|
'float': FloatRange(),
|
||||||
'text': StringType(),
|
'text': StringType(),
|
||||||
'int': IntRange(-1 << 63, 1 << 63 - 1),
|
'int': IntRange(-1 << 63, 1 << 63 - 1),
|
||||||
'bool': BoolType(),
|
'bool': SeaBool(),
|
||||||
'none': None,
|
'none': None,
|
||||||
'floatvarar': ArrayOf(FloatRange(), 0, 400), # 400 is the current limit for proper notify events in SEA
|
'floatvarar': ArrayOf(FloatRange(), 0, 400), # 400 is the current limit for proper notify events in SEA
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user