Esempio n. 1
0
 def logState(self, value, test=False):
     status_qualifier = 'Success'
     if test:
         status_qualifier = 'Test'
     jsn = makeEnvJson('State_Change', 'Lights', 'Top', 'State', value,
                       'Lights', status_qualifier)
     CouchDB.logEnvObsvJSON(jsn)
Esempio n. 2
0
def getAirTopHumidityObsv(test=False):
    '''Create json structure for humidity'''
    humid = si.getHumidity()
    status_qualifier = 'Success'
    cmt = ''

    if humid == None:
        status_qualifier = 'Failure'
        cmt = 'Failure reading sensor'
    if test:
        status_qualifier = 'Test'
    return makeEnvJson(activity_type,
                       'Air',
                       'Left_Side',
                       'Humidity',
                       '{:3.1f}'.format(humid),
                       'SI7021',
                       status_qualifier,
                       comment=cmt)
Esempio n. 3
0
def getAirTopTempObsv(test=False):
    '''Create json structure for temp'''
    temp = si.getTempC()

    status_qualifier = 'Success'
    cmt = ''

    if temp == None:
        status_qualifier = 'Failure'
        cmt = 'Failure reading sensor'
    if test:
        status_qualifier = 'Test'
    return makeEnvJson(activity_type,
                       'Air',
                       'Left_Side',
                       'Temperature',
                       '{:3.1f}'.format(temp),
                       'SI7021',
                       status_qualifier,
                       comment=cmt)
Esempio n. 4
0
File: Fan.py Progetto: r3lax/MVP-III
 def logState(self, value, test=False):
     status_qualifier = 'Success'
     if test:
         status_qualifier = 'Test'
     jsn = makeEnvJson('Fan', 'Side', 'state', value, status_qualifier)
     CouchDB.logEnvObsv(jsn)