def addExternalWeather(date_time, city, temp_c): print("Saving external weather") client = CouchDB("admin", "password", url="http://10.0.0.19:5984", connect=True) db = client.create_database("externalweather") data = {} data["temp"] = str(temp_c) data["format"] = "C" data["city"] = str(city) doc = db.create_document(data) doc.save() client.disconnect()
def addInternalWeather(date_time, temp_c): print("Saving internal weather") client = CouchDB("admin", "password", url="http://10.0.0.19:5984", connect=True) db = client.create_database("internalweather") data = {} # data[date_time.strftime("%Y-%m-%dT%H:%M:%S")] data["temp"] = str(temp_c) data["format"] = "C" data["datetime"] = date_time.strftime("%Y-%m-%dT%H:%M:%S") doc = db.create_document(data) doc.save() client.disconnect()