Influx should not be capitalized as it's a variable name
None of this code:
with open("config.yaml", "r") as ymlfile:
cfg = yaml.load(ymlfile,Loader=SafeLoader)
Influx = ...
There are bugs and the code is accessibly noisy.
Some source code style points
Avoid unneeded code as it is just noise. Code noise makes code harder to read amd maintain.
Use enum class
Consider using enum class instead of a plain enum for a little more type safety.
I would also recommend you use all-caps for the names of the enum options, as this is commonly done and is a strong hint that those are constants and not variables.
Prefer using switch-statements when enums are involved
Use a switch-statement instead of a chain of ...