fastiot.db.influxdb_helper_fn module

class fastiot.db.influxdb_helper_fn.Client[source]

Singleton for Async InfluxDB Client

client = None
async fastiot.db.influxdb_helper_fn.get_async_influxdb_client_from_env()[source]

For connecting Influxdb, the environment variables can be set, if you want to use your own settings instead of default: FASTIOT_INFLUX_DB_HOST, FASTIOT_INFLUX_DB_PORT, FASTIOT_INFLUX_DB_TOKEN

After setting up the InfluxDB Server, the InfluxDB Server provides the possibility to visualize data in this database using browser with “http:<host>:<port>”. Default username: influx_db_admin and password: mf9ZXfeLKuaL3HL7w. You can also change these default values by editing FASTIOT_INFLUX_DB_USER and FASTIOT_INFLUX_DB_PASSWORD.

>>> influxdb_client = await get_async_influxdb_client_from_env()
async fastiot.db.influxdb_helper_fn.get_new_async_influx_client_from_env()[source]

Instead of using the singleton like in get_async_influxdb_client_from_env() a new connection to the database will be established. This seems to be necessary in some test cases.

async fastiot.db.influxdb_helper_fn.create_async_influxdb_client_from_env()[source]
async fastiot.db.influxdb_helper_fn.influx_query(machine, name, start_time, end_time)[source]
fastiot.db.influxdb_helper_fn.influx_query_wrapper(coro, *args)[source]