def getSensorData(sensorId): sensor = function.getSensor(int(sensorId)) sensorData = json.loads(sensor) sensorName = sensorData['name'] fileName = sensorName + sensorId sensorData_ = function.file("/home/pi/Desktop/Flow_sensor/json/" + fileName + ".json") return sensorData_
def pinSensorId(pin): sensor = function.getSensor(int(pin)) return sensor
def getSensor(sensorId): sensor_ = function.getSensor(int(sensorId)) return sensor_