Home2L - Python API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Classes | Functions
home2l Namespace Reference

The Home2L package. More...

Classes

class  _SwigNonDynamicMeta
 
class  URcValue
 
class  CRcValueState
 
class  CResource
 
class  CRcEvent
 
class  CRcEventProcessor
 
class  CRcEventTimer
 
class  CRcSubscriber
 
class  CRcRequest
 
class  CRcEventDriver
 

Functions

def EnvBuildOS ()
 
def EnvBuildArch ()
 
def EnvMachineName ()
 
def EnvExecPathName ()
 
def EnvExecName ()
 
def EnvInstanceName ()
 
def EnvDroidId ()
 
def EnvPid ()
 
def EnvHaveTerminal ()
 
def EnvReadIniFile (fileName, map)
 
def EnvHome2lRoot ()
 
def EnvHome2lEtc ()
 
def EnvHome2lVar ()
 
def EnvHome2lTmp ()
 
def EnvGetHome2lRootPath (relOrAbsPath)
 
def EnvGetHome2lEtcPath (relOrAbsPath)
 
def EnvGetHome2lVarPath (relOrAbsPath)
 
def EnvGetHome2lTmpPath (relOrAbsPath)
 
def EnvMkVarDir (relOrAbsPath)
 
def EnvMkTmpDir (relOrAbsPath)
 
def EnvNetResolve (hostAndPort, retHost, retPort=None, defaultPort=0, warn=True)
 
def EnvLocationLatitudeN ()
 
def EnvLocationLongitudeE ()
 
def EnvInit (argc, argv, specOptionsUsage=None, instanceName=None, noBanner=False)
 
def EnvPrintBanner ()
 
def EnvDone ()
 
def EnvEnablePersistence (writeThrough=True, _varFileName=None)
 
def EnvFlush ()
 
def EnvGet (key)
 
def EnvPut (*args)
 
def EnvDel (key)
 
def RcTypeGetName (t)
 
def RcTypeGetFromName (name)
 
def RcTypeGetBaseType (t)
 
def RcTypeIsStringBased (t)
 
def RcTypeIsUnitType (t)
 
def RcTypeGetUnit (t)
 
def RcTypeIsEnumType (t)
 
def RcTypeGetEnumValues (t)
 
def RcTypeGetEnumValue (t, idx, warn=True)
 
def RcTypeGetEnumIdx (t, value, warn=True)
 
def CResource_Get (uri, allowWait=False)
 
def CResource_GarbageCollection ()
 
def CRcEventProcessor_Select (maxTime=-1)
 
def RcGetUserRequestId ()
 
def RcGetUserRequestAttrs ()
 
def RcGetHosts ()
 
def RcGetHost (*args)
 
def RcGetHostId (host)
 
def RcLocalHostId ()
 
def RcHosts ()
 Return a list of all known hosts (including our own one as #0). More...
 
def RcGetDrivers ()
 
def RcGetDriver (*args)
 
def RcGetDriverId (cur)
 
def RcDrivers ()
 Return a list of all locally defined drivers. More...
 
def RcLockHostResources (host)
 
def RcGetHostResource (host, n)
 
def RcUnlockHostResources (host)
 
def RcLockDriverResources (driver)
 
def RcGetDriverResource (driver, n)
 
def RcUnlockDriverResources (driver)
 
def RcHostResources (hostName)
 Return all known resources of a remote host. More...
 
def RcDriverResources (driverName)
 Return all local resources managed by a driver. More...
 
def RcResources ()
 Return a complete list of all known resources. More...
 
def NewResource (rcName, rcType, func=None, data=None)
 Define a new local resource. More...
 
def resource (rcName, rcType, data=None)
 Decorator to define a new local resource. More...
 
def NewGate (rcName, rcType, rcSet, func, subscrId=None)
 Define a new gate. More...
 
def gate (rcName, rcType, *rcSet)
 Decorator to define a new gate. More...
 
def GetLocalRc (func)
 Get resource reference of a decorated local resource or gate. More...
 
def NewSignal (sigName, rcType, defaultVal=None)
 Define a new signal. More...
 
def NewDriver (drvName, func=None, successState=rcsNoReport, data=None)
 Define a new driver. More...
 
def driver (drvName, successState=rcsBusy, data=None)
 Decorator to define a new driver. More...
 
def NewDriverResource (drvName, rcName, rcType, writable=True)
 Define a new resource. More...
 
def RunOnEvent (func, rcSet, data=None, subscrId=None)
 Define a function to be called on events. More...
 
def onEvent (*rcSet)
 Decorator to define a function to be called on events. More...
 
def RunOnUpdate (func, rcSet, data=None, subscrId=None)
 Define a function to be called on value/state changes of resources. More...
 
def onUpdate (*rcSet)
 Decorator to define a function to be called on value/state changes. More...
 
def Connect (target, rcSet, func=lambda x:x, attrs=None, id=None, priority=None, t0=None, hysteresis=None, delDelay=None, subscrId=None)
 Define a connector between resources. More...
 
def connect (target, rcSet, attrs=None, id=None, priority=None, t0=None, hysteresis=None, delDelay=None)
 Decorator to define a connector. More...
 
def RunAt (func, t=0, dt=0, args=None, subscrId=None)
 Let a function be called at a given time or periodically. More...
 
def at (t=0, dt=0, args=None)
 Decorator to let a function be called at a given time or periodically. More...
 
def RunDaily (func, hostSet=None, data=None, subscrId=None)
 Let a function be called daily for setting permanent requests. More...
 
def daily (*hostSet)
 Decorator to let a function be called daily for setting permanent requests. More...
 
def TicksNow ()
 
def TicksToday ()
 
def TicksOfDate (dy, dm, dd)
 
def TicksOfTime (th, tm, ts)
 
def TicksOfSeconds (*args)
 
def TicksOfMillis (ms)
 
def TicksAbsFromMonotic (tm)
 
def TicksMonotonicFromAbs (ta)
 
def TicksAbsStr (ticks)
 
def TicksRelStr (ticks)
 
def TicksAbsOf (something)
 
def TicksRelOf (something)
 
def TicksToPyDateTime (t)
 
def TicksToPyTimeDelta (t)
 
def TicksFromUTC (t)
 
def TicksToUTC (t)
 
def Home2lInit (instance=None, server=False, args=True)
 
def Home2lDone ()
 
def Home2lStart ()
 End the elaboration and start the background activities of the Home2L package. More...
 
def Home2lIterate (maxTime=0)
 Iterate Home2L and run all pending callback functions. More...
 
def Home2lRun ()
 Run the Home2L main loop indefinitely (or until stopped). More...
 
def Home2lStop ()
 Let 'Home2lRun()' stop at next occasion. More...
 
Accessing resources ...
def RcGetResource (uri, allowWait=False)
 
def RcGet (uri, allowWait=False)
 
def RcGarbageCollection ()
 
def RcBump (rc=None, soft=False)
 
Subscriptions (from C/C++ API) ...

Low-level operations to directly create and use CRcSubscriber objects.

Most probably, you will not need these functions. The preferred way in Python is to use the more compfortable decorators and operations in section "Subscriptions, events and timers (Python API)" below.

def RcNewSubscriber (*args)
 
def RcSubscribe (*args)
 
def RcUnsubscribeFromAll (subscr)
 
Placing requests ...

Details on the request arguments can be found in the C/C++ API documentation and the Home2L Book.

def RcSetRequest (rc, reqDef=None, attrs=None, value=None, id=None, priority=None, t0=None, t1=None, repeat=None, hysteresis=None, delDelay=None)
 
def RcSetTrigger (rc, attrs=None, id=None, priority=None, t0=None, t1=None, repeat=None, hysteresis=None)
 
def RcDelRequest (rc, id=None, t1=None)
 
def RcSetDefault (rc, reqDef=None, attrs=None, value=None, t0=None, t1=None, repeat=None, hysteresis=None, delDelay=None)
 
Drivers (from C/C++ API) ...

Low-level operations to directly create and use 'CRcDriver' objects.

Most probably, you will not need these functions. The preferred way in Python is to use the more compfortable decorators and operations in module "Home2L / Drivers".

def RcRegisterDriver (drvLid, _successState=rcsNoReport)
 
def RcRegisterResource (*args)
 
def RcRegisterSignal (*args)
 

Detailed Description

The Home2L package.