Home2L - Python API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
|
Home2L Resource. This is the most central class of the library. A 'Resource' may represent a sensor, an actor, a stored value, a virtual device, a mutex, an event trigger - almost anything. Resources are identified by a uniform resource identifier (URI).
Inherits object.
Public Member Functions | |
def | Uri (self) |
def | Gid (self) |
def | Lid (self) |
def | Is (self, *args) |
def | IsLike (self, pattern) |
def | IsWritable (self) |
def | ToStr (self, ret, pathLocal=False) |
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 | Subscribe (self, subscr) |
def | Unsubscribe (self, subscr) |
def | GetRequestSet (self, ret, allowNet=True) |
def | GetRequest (self, reqGid, allowNet=True) |
def | WriteValue (self, *args) |
def | UnWrite (self, *args) |
def | SetDefault (self, *args) |
def | Unregister (self) |
def | SetUserData (self, _data) |
def | UserData (self) |
def | ReportValueState (self, _valueState) |
def | ReportTrigger (self) |
def | ReportState (self, _state) |
def | ReportBusy (self) |
def | ReportUnknown (self) |
def | RedriveValue (self, force=True) |
def | PrintInfo (self, *args) |
def | LockLocalSubscribers (self) |
def | GetLocalSubscriber (self, n) |
def | UnlockLocalSubscribers (self) |
def | LockLocalRequests (self) |
def | GetLocalRequest (self, n) |
def | UnlockLocalRequests (self) |
def | ValueState (self) |
def | Value (self) |
def | ValidValue (self, defaultVal) |
def | SetRequest (self, reqDef=None, attrs=None, value=None, id=None, priority=None, t0=None, t1=None, repeat=None, hysteresis=None, delDelay=None) |
def | SetTrigger (self, attrs=None, id=None, priority=None, t0=None, t1=None, repeat=None, hysteresis=None) |
def | DelRequest (self, reqId=None, t1=None) |
def | ReportValue (self, value, state=rcsValid) |
Static Public Member Functions | |
def | Get (uri, allowWait=False) |
def | GarbageCollection () |
|
static |
Get(char const * uri, bool allowWait=False) -> CResource
|
static |
GarbageCollection()
def Uri | ( | self | ) |
Uri(CResource self) -> char const *
def Gid | ( | self | ) |
Gid(CResource self) -> char const *
def Lid | ( | self | ) |
Lid(CResource self) -> char const *
def Is | ( | self, | |
* | args | ||
) |
Is(CResource self, char const * uri) -> bool Is(CResource self, CResource rc) -> bool
def IsLike | ( | self, | |
pattern | |||
) |
IsLike(CResource self, char const * pattern) -> bool
def IsWritable | ( | self | ) |
IsWritable(CResource self) -> bool
def ToStr | ( | self, | |
ret, | |||
pathLocal = False |
|||
) |
ToStr(CResource self, CString * ret, bool pathLocal=False) -> char const
def Type | ( | self | ) |
Type(CResource self) -> ERcType
def State | ( | self | ) |
State(CResource self) -> ERcState
def TimeStamp | ( | self | ) |
TimeStamp(CResource self) -> TTicks
def IsValid | ( | self | ) |
IsValid(CResource self) -> bool
def IsBusy | ( | self | ) |
IsBusy(CResource self) -> bool
def IsKnown | ( | self | ) |
IsKnown(CResource self) -> bool
def Equals | ( | self, | |
vs2 | |||
) |
Equals(CResource self, CRcValueState vs2) -> bool
def ValueEquals | ( | self, | |
vs2 | |||
) |
ValueEquals(CResource self, CRcValueState vs2) -> bool
def Subscribe | ( | self, | |
subscr | |||
) |
Subscribe(CResource self, CRcSubscriber subscr) -> CResource
def Unsubscribe | ( | self, | |
subscr | |||
) |
Unsubscribe(CResource self, CRcSubscriber subscr)
def GetRequestSet | ( | self, | |
ret, | |||
allowNet = True |
|||
) |
GetRequestSet(CResource self, CRcRequestSet * ret, bool allowNet=True) -> bool
def GetRequest | ( | self, | |
reqGid, | |||
allowNet = True |
|||
) |
GetRequest(CResource self, char const * reqGid, bool allowNet=True) -> CRcRequest
def WriteValue | ( | self, | |
* | args | ||
) |
WriteValue(CResource self, CRcValueState value, int priority=-1, char const * reqGid="write")
def UnWrite | ( | self, | |
* | args | ||
) |
UnWrite(CResource self, char const * reqGid="write")
def SetDefault | ( | self, | |
* | args | ||
) |
SetDefault(CResource self, CRcValueState vs) SetDefault(CResource self, bool valBool) SetDefault(CResource self, int valInt) SetDefault(CResource self, float valFloat) SetDefault(CResource self, char const * valString) SetDefault(CResource self, TTicks valTime)
def Unregister | ( | self | ) |
Unregister(CResource self)
def SetUserData | ( | self, | |
_data | |||
) |
SetUserData(CResource self, void * _data)
def UserData | ( | self | ) |
UserData(CResource self) -> void *
def ReportValueState | ( | self, | |
_valueState | |||
) |
ReportValueState(CResource self, CRcValueState _valueState)
def ReportTrigger | ( | self | ) |
ReportTrigger(CResource self)
def ReportState | ( | self, | |
_state | |||
) |
ReportState(CResource self, ERcState _state)
def ReportBusy | ( | self | ) |
ReportBusy(CResource self)
def ReportUnknown | ( | self | ) |
ReportUnknown(CResource self)
def RedriveValue | ( | self, | |
force = True |
|||
) |
RedriveValue(CResource self, bool force=True)
def PrintInfo | ( | self, | |
* | args | ||
) |
PrintInfo(CResource self, FILE * f=stdout, int verbosity=1, bool allowNet=True)
def LockLocalSubscribers | ( | self | ) |
LockLocalSubscribers(CResource self) -> int
def GetLocalSubscriber | ( | self, | |
n | |||
) |
GetLocalSubscriber(CResource self, int n) -> CRcSubscriber
def UnlockLocalSubscribers | ( | self | ) |
UnlockLocalSubscribers(CResource self)
def LockLocalRequests | ( | self | ) |
LockLocalRequests(CResource self) -> int
def GetLocalRequest | ( | self, | |
n | |||
) |
GetLocalRequest(CResource self, int n) -> CRcRequest
def UnlockLocalRequests | ( | self | ) |
UnlockLocalRequests(CResource self)
def ValueState | ( | self | ) |
ValueState(CResource self) -> CRcValueState Get the current value and state of the resource.
def Value | ( | self | ) |
Get a value ('None' if invalid) of this resource (use ValueState() to get the complete value and state).
def ValidValue | ( | self, | |
defaultVal | |||
) |
Get a valid value of this resource (use ValueState() to get the complete value and state).
def SetRequest | ( | self, | |
reqDef = None , |
|||
attrs = None , |
|||
value = None , |
|||
id = None , |
|||
priority = None , |
|||
t0 = None , |
|||
t1 = None , |
|||
repeat = None , |
|||
hysteresis = None , |
|||
delDelay = None |
|||
) |
Set or delete a request with selected attributes. This method allows to set any subset of attributes in a flexible way, either by (named) function arguments or by a textual description as accepted by the Home2L Shell or CRcRequest::SetFromStr(). If the effective value is 'None' (no value is passed), the call will delete the request with the specified ID passing 'delDelay' as the 't1' argument of DelRequest(). See RcSetRequest() for a detailed explanation of the arguments and examples.
def SetTrigger | ( | self, | |
attrs = None , |
|||
id = None , |
|||
priority = None , |
|||
t0 = None , |
|||
t1 = None , |
|||
repeat = None , |
|||
hysteresis = None |
|||
) |
Set a request for a trigger resource with selected attributes.
def DelRequest | ( | self, | |
reqId = None , |
|||
t1 = None |
|||
) |
Delete a request by its ID.
def ReportValue | ( | self, | |
value, | |||
state = rcsValid |
|||
) |
Report a new value and optionally its state. If '_value == None', 'ReportUnknown()' is called.