provide a status2 parameter
for testing. I'd like to have human-readable string together with the status code. Since converting status to a vector needs code-changes in all devices, as a first step we implement a differently named parameter to play with and to decide which we would like better. Change-Id: Ib73b8e5bd817ffdee4d413cfd8dddf46ec5e863d
This commit is contained in:
@ -33,7 +33,7 @@ import inspect
|
|||||||
|
|
||||||
from errors import ConfigError, ProgrammingError
|
from errors import ConfigError, ProgrammingError
|
||||||
from protocol import status
|
from protocol import status
|
||||||
from validators import mapping
|
from validators import mapping, vector
|
||||||
|
|
||||||
EVENT_ONLY_ON_CHANGED_VALUES = True
|
EVENT_ONLY_ON_CHANGED_VALUES = True
|
||||||
|
|
||||||
@ -263,6 +263,14 @@ class Readable(Device):
|
|||||||
'ERROR': status.ERROR,
|
'ERROR': status.ERROR,
|
||||||
'UNKNOWN': status.UNKNOWN}),
|
'UNKNOWN': status.UNKNOWN}),
|
||||||
readonly=True),
|
readonly=True),
|
||||||
|
'status2': PARAM('current status of the device', default=(status.OK, ''),
|
||||||
|
validator=vector(mapping(**{'idle': status.OK,
|
||||||
|
'BUSY': status.BUSY,
|
||||||
|
'WARN': status.WARN,
|
||||||
|
'UNSTABLE': status.UNSTABLE,
|
||||||
|
'ERROR': status.ERROR,
|
||||||
|
'UNKNOWN': status.UNKNOWN}), str),
|
||||||
|
readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user