Home2L - Python API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
|
Typed value tagged with a state and a time stamp. The constants for type 'ERcType' have the prefix 'rct*'.The state may be one of: 'rcsUnknown': The value is unknown. 'rcsBusy': The value is known, the underlying device is busy. 'rcsValid': The value is known and stable. The time stamp reflects the age of a value (last change/update). It is generally not valid to judge from the time stamp whether the value is outdated, since there are other mechanisms in the library setting the state to 'rcsUnknown' if, for example, the connection to a remote resource got lost.
Inherits object.
Public Member Functions | |
def | Clear (self, *args) |
def | Set (self, vs2) |
def | SetToReportBusy (self) |
def | SetToReportBusyOldVal (self) |
def | SetToReportBusyNewVal (self) |
def | SetToReportNothing (self) |
def | SetGenericInt (self, _val, _type, _state=rcsValid) |
def | SetGenericFloat (self, _val, _type, _state=rcsValid) |
def | SetGenericString (self, _val, _type, _state=rcsValid) |
def | SetBool (self, _val, _state=rcsValid) |
def | SetInt (self, _val, _state=rcsValid) |
def | SetFloat (self, _val, _state=rcsValid) |
def | SetString (self, _val, _state=rcsValid) |
def | SetTime (self, _val, _state=rcsValid) |
def | SetTrigger (self, _val=1, _state=rcsValid) |
def | SetMutex (self, _val, _state=rcsValid) |
def | SetUnitInt (self, type, _val, _state=rcsValid) |
def | SetUnitFloat (self, type, _val, _state=rcsValid) |
def | SetEnum (self, type, _val, _state=rcsValid) |
def | GenericInt (self) |
def | GenericFloat (self) |
def | GenericString (self) |
def | Bool (self) |
def | Int (self) |
def | Float (self) |
def | String (self) |
def | Time (self) |
def | Trigger (self) |
def | Mutex (self) |
def | UnitInt (self, _type) |
def | UnitFloat (self, _type) |
def | EnumIdx (self) |
def | ValidBool (self, defaultVal=False) |
def | ValidInt (self, defaultVal=0) |
def | ValidFloat (self, defaultVal=0.0) |
def | ValidString (self, *args) |
def | ValidTime (self, defaultVal=0) |
def | ValidTrigger (self, defaultVal=0) |
def | ValidMutex (self, *args) |
def | ValidUnitInt (self, _type, defaultVal=0) |
def | ValidUnitFloat (self, _type, defaultVal=0.0) |
def | ValidEnumIdx (self, _type, defaultVal=0) |
def | SetType (self, _type) |
def | SetState (self, _state) |
def | SetTimeStamp (self, _timeStamp) |
def | Type (self) |
def | State (self) |
def | TimeStamp (self) |
def | IsValid (self) |
def | IsBusy (self) |
def | IsKnown (self) |
def | Equals (self, vs2) |
def | ValueEquals (self, vs2) |
def | Convert (self, _type) |
def | ToStr (self, ret, withType=False, withTimeStamp=False, precise=False, stringChars=20) |
def | SetFromStr (self, str) |
def | SetFromStrFast (self, str, warn=True) |
def | ToHuman (self, retBuf, retBufSize) |
def | Value (self) |
Return the value as a Python object. More... | |
def | ValidValue (self, defaultVal) |
Return the most appropriate valid value as a Python object. More... | |
def Clear | ( | self, | |
* | args | ||
) |
Clear(CRcValueState self) Clear(CRcValueState self, ERcType _type, ERcState _state=rcsUnknown)
def Set | ( | self, | |
vs2 | |||
) |
Set(CRcValueState self, CRcValueState vs2)
def SetToReportBusy | ( | self | ) |
SetToReportBusy(CRcValueState self)
def SetToReportBusyOldVal | ( | self | ) |
SetToReportBusyOldVal(CRcValueState self)
def SetToReportBusyNewVal | ( | self | ) |
SetToReportBusyNewVal(CRcValueState self)
def SetToReportNothing | ( | self | ) |
SetToReportNothing(CRcValueState self)
def SetGenericInt | ( | self, | |
_val, | |||
_type, | |||
_state = rcsValid |
|||
) |
SetGenericInt(CRcValueState self, int _val, ERcType _type, ERcState _state=rcsValid)
def SetGenericFloat | ( | self, | |
_val, | |||
_type, | |||
_state = rcsValid |
|||
) |
SetGenericFloat(CRcValueState self, float _val, ERcType _type, ERcState _state=rcsValid)
def SetGenericString | ( | self, | |
_val, | |||
_type, | |||
_state = rcsValid |
|||
) |
SetGenericString(CRcValueState self, char const * _val, ERcType _type, ERcState _state=rcsValid) -> bool
def SetBool | ( | self, | |
_val, | |||
_state = rcsValid |
|||
) |
SetBool(CRcValueState self, bool _val, ERcState _state=rcsValid)
def SetInt | ( | self, | |
_val, | |||
_state = rcsValid |
|||
) |
SetInt(CRcValueState self, int _val, ERcState _state=rcsValid)
def SetFloat | ( | self, | |
_val, | |||
_state = rcsValid |
|||
) |
SetFloat(CRcValueState self, float _val, ERcState _state=rcsValid)
def SetString | ( | self, | |
_val, | |||
_state = rcsValid |
|||
) |
SetString(CRcValueState self, char const * _val, ERcState _state=rcsValid) -> bool
def SetTime | ( | self, | |
_val, | |||
_state = rcsValid |
|||
) |
SetTime(CRcValueState self, TTicks _val, ERcState _state=rcsValid)
def SetTrigger | ( | self, | |
_val = 1 , |
|||
_state = rcsValid |
|||
) |
SetTrigger(CRcValueState self, int _val=1, ERcState _state=rcsValid)
def SetMutex | ( | self, | |
_val, | |||
_state = rcsValid |
|||
) |
SetMutex(CRcValueState self, char const * _val, ERcState _state=rcsValid) -> bool
def SetUnitInt | ( | self, | |
type, | |||
_val, | |||
_state = rcsValid |
|||
) |
SetUnitInt(CRcValueState self, ERcType type, int _val, ERcState _state=rcsValid)
def SetUnitFloat | ( | self, | |
type, | |||
_val, | |||
_state = rcsValid |
|||
) |
SetUnitFloat(CRcValueState self, ERcType type, float _val, ERcState _state=rcsValid)
def SetEnum | ( | self, | |
type, | |||
_val, | |||
_state = rcsValid |
|||
) |
SetEnum(CRcValueState self, ERcType type, int _val, ERcState _state=rcsValid)
def GenericInt | ( | self | ) |
GenericInt(CRcValueState self) -> int
def GenericFloat | ( | self | ) |
GenericFloat(CRcValueState self) -> float
def GenericString | ( | self | ) |
GenericString(CRcValueState self) -> char const *
def Bool | ( | self | ) |
Bool(CRcValueState self) -> bool
def Int | ( | self | ) |
Int(CRcValueState self) -> int
def Float | ( | self | ) |
Float(CRcValueState self) -> float
def String | ( | self | ) |
String(CRcValueState self) -> char const *
def Time | ( | self | ) |
Time(CRcValueState self) -> TTicks
def Trigger | ( | self | ) |
Trigger(CRcValueState self) -> int
def Mutex | ( | self | ) |
Mutex(CRcValueState self) -> char const *
def UnitInt | ( | self, | |
_type | |||
) |
UnitInt(CRcValueState self, ERcType _type) -> int
def UnitFloat | ( | self, | |
_type | |||
) |
UnitFloat(CRcValueState self, ERcType _type) -> float
def EnumIdx | ( | self | ) |
EnumIdx(CRcValueState self) -> int
def ValidBool | ( | self, | |
defaultVal = False |
|||
) |
ValidBool(CRcValueState self, bool defaultVal=False) -> bool
def ValidInt | ( | self, | |
defaultVal = 0 |
|||
) |
ValidInt(CRcValueState self, int defaultVal=0) -> int
def ValidFloat | ( | self, | |
defaultVal = 0.0 |
|||
) |
ValidFloat(CRcValueState self, float defaultVal=0.0) -> float
def ValidString | ( | self, | |
* | args | ||
) |
ValidString(CRcValueState self, char const * defaultVal=CString::emptyStr) -> char const
def ValidTime | ( | self, | |
defaultVal = 0 |
|||
) |
ValidTime(CRcValueState self, TTicks defaultVal=0) -> TTicks
def ValidTrigger | ( | self, | |
defaultVal = 0 |
|||
) |
ValidTrigger(CRcValueState self, int defaultVal=0) -> int
def ValidMutex | ( | self, | |
* | args | ||
) |
ValidMutex(CRcValueState self, char const * defaultVal=CString::emptyStr) -> char const
def ValidUnitInt | ( | self, | |
_type, | |||
defaultVal = 0 |
|||
) |
ValidUnitInt(CRcValueState self, ERcType _type, int defaultVal=0) -> int
def ValidUnitFloat | ( | self, | |
_type, | |||
defaultVal = 0.0 |
|||
) |
ValidUnitFloat(CRcValueState self, ERcType _type, float defaultVal=0.0) -> float
def ValidEnumIdx | ( | self, | |
_type, | |||
defaultVal = 0 |
|||
) |
ValidEnumIdx(CRcValueState self, ERcType _type, int defaultVal=0) -> int
def SetType | ( | self, | |
_type | |||
) |
SetType(CRcValueState self, ERcType _type)
def SetState | ( | self, | |
_state | |||
) |
SetState(CRcValueState self, ERcState _state)
def SetTimeStamp | ( | self, | |
_timeStamp | |||
) |
SetTimeStamp(CRcValueState self, TTicks _timeStamp)
def Type | ( | self | ) |
Type(CRcValueState self) -> ERcType
def State | ( | self | ) |
State(CRcValueState self) -> ERcState
def TimeStamp | ( | self | ) |
TimeStamp(CRcValueState self) -> TTicks
def IsValid | ( | self | ) |
IsValid(CRcValueState self) -> bool
def IsBusy | ( | self | ) |
IsBusy(CRcValueState self) -> bool
def IsKnown | ( | self | ) |
IsKnown(CRcValueState self) -> bool
def Equals | ( | self, | |
vs2 | |||
) |
Equals(CRcValueState self, CRcValueState vs2) -> bool
def ValueEquals | ( | self, | |
vs2 | |||
) |
ValueEquals(CRcValueState self, CRcValueState vs2) -> bool
def Convert | ( | self, | |
_type | |||
) |
Convert(CRcValueState self, ERcType _type) -> bool
def ToStr | ( | self, | |
ret, | |||
withType = False , |
|||
withTimeStamp = False , |
|||
precise = False , |
|||
stringChars = 20 |
|||
) |
ToStr(CRcValueState self, CString * ret, bool withType=False, bool withTimeStamp=False, bool precise=False, int stringChars=20) -> char const
def SetFromStr | ( | self, | |
str | |||
) |
SetFromStr(CRcValueState self, char const * str) -> bool
def SetFromStrFast | ( | self, | |
str, | |||
warn = True |
|||
) |
SetFromStrFast(CRcValueState self, char const * str, bool warn=True) -> bool
def ToHuman | ( | self, | |
retBuf, | |||
retBufSize | |||
) |
ToHuman(CRcValueState self, char * retBuf, int retBufSize)
def Value | ( | self | ) |
Return the value as a Python object.
Return the value as a Python object. In case of a state of 'rcsUnknown' or if 'self' is not defined, 'None' is returned. 'self == None' is allowed.
def ValidValue | ( | self, | |
defaultVal | |||
) |
Return the most appropriate valid value as a Python object.
Return the value as a Python object. Unlike 'Value', this method never returns 'None', but reverts to the given default value, if 'self' does not transort a valid value. 'self == None' is tolerated