deleted draining period and amount from config file as this does not work like i thought it would

This commit is contained in:
2016-06-09 20:56:42 +02:00
parent 4872f4a910
commit cfd7d677dd
4 changed files with 3 additions and 11 deletions

View File

@@ -12,8 +12,6 @@ GPIO_PIN_OUT_VALVE = 21 # BCM
GPIO_PIN_IN_VALVE = 18 # BCM
START_PUMPING_AT = 'TANKLEVEL4'
STOP_PUMPING_AT = 'TANKFULL'
DRAINING_PERIOD_AMOUNT = 40
DRAINING_PERIOD_UNIT = 'minutes'
API_BASE_URL = 'http://agrar.zoblak.com/api/v1.0'
CONTROLLER_ID = '120' # every controller must have a different one
STATE_FILE = '/var/run/controller_state'

View File

@@ -35,8 +35,6 @@ print 'Bacva puna: {}'.format(tankFull)
SENSOR_TYPE = Adafruit_DHT.DHT11
controller_id = config.CONTROLLER_ID
owner = "Controller: %s" % controller_id
drainingPeriodAmount = config.DRAINING_PERIOD_AMOUNT
drainingPeriodUnit = config.DRAINING_PERIOD_UNIT
startPumpingAt = config.START_PUMPING_AT
stopPumpingAt = config.STOP_PUMPING_AT
@@ -53,7 +51,7 @@ humidity, temperature = Adafruit_DHT.read_retry(SENSOR_TYPE, config.GPIO_PIN_DHT
# If this happens try again!
if temperature is not None and humidity is not None:
response = requests.post(config.SENSORDATA_URL, json={"owner": owner, "temperatureValue": temperature, "humidityValue":humidity, "tankLevel0": "1" if tankLevel0 else "0","tankLevel1": "1" if tankLevel1 else "0","tankLevel2": "1" if tankLevel2 else "0","tankLevel3": "1" if tankLevel3 else "0", "tankLevel4": "1" if tankLevel4 else "0", "tankFull": "1" if tankFull else "0",
"startPumpingAt": startPumpingAt,"stopPumpingAt": stopPumpingAt,"drainingPeriodAmount":drainingPeriodAmount,"drainingPeriodUnit":drainingPeriodUnit,"controllerId": controller_id
"startPumpingAt": startPumpingAt,"stopPumpingAt": stopPumpingAt,"controllerId": controller_id
})
print 'Temp={0:0.1f}*C'.format(temperature)
print 'Humidity={0:0.1f}%'.format(humidity)