Ejemplo n.º 1
0
def main():
    redox_value = 0.0
    if boxsettings.FAKE_DATA:
        redox_value = get_random_redox()
    else:
        redox_value = getORP()
    print "Redox: ", redox_value
    logging.debug("Redox value: %s", redox_value)
    sender = Sender()
    sender.send_redox(redox_value)
Ejemplo n.º 2
0
 def send_measures(self):
     self.logger.info('Sending measures..')
     redox_sent = ph_sent = temp_sent = False
     sender = Sender()
     self.logger.debug('orp...')
     try:
         sender.send_redox(float(self.orp_value))
         redox_sent = True
     except Exception, e:
         self.logger.warning('We was not able to send redox to REST',
                             exc_info=True)
Ejemplo n.º 3
0
 def btest_sender_redox_1020(self):
     # TODO: strengthen out of range values
     sender = Sender()
     value = 1020.0
     response = sender.send_redox(value)
     self.assertEqual(201, response.status_code)
Ejemplo n.º 4
0
 def btest_sender_redox(self):
     sender = Sender()
     value = self.get_random_redox()
     response = sender.send_redox(value)
     self.assertEqual(201, response.status_code)