Skip to content

Commit

Permalink
Ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnerWill committed Feb 5, 2025
1 parent 38b8e72 commit dfec885
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions grafana/sensor_data_collector/fetch_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
logging.basicConfig(level=logging.INFO)

# Get environment variables with default values if they do not exist
ESP32_IP: str = str(os.getenv("ESP32_IP", "http://192.168.0.30")) # Default to a placeholder IP
INFLUXDB_HOST: str = str(os.getenv("INFLUXDB_HOST", "influxdb")) # Default to the container name
INFLUXDB_PORT: int = int(os.getenv("INFLUXDB_PORT", 8086)) # Default to 8086
INFLUXDB_DB: str = str(os.getenv("INFLUXDB_DB", "esp32_data")) # Default database name
POLL_INTERVAL: int = int(os.getenv("POLL_INTERVAL", 2)) # Default polling interval to 2 seconds
ESP32_IP: str = str(
os.getenv("ESP32_IP", "http://192.168.0.30")
) # Default to a placeholder IP
INFLUXDB_HOST: str = str(
os.getenv("INFLUXDB_HOST", "influxdb")
) # Default to the container name
INFLUXDB_PORT: int = int(os.getenv("INFLUXDB_PORT", 8086)) # Default to 8086
INFLUXDB_DB: str = str(os.getenv("INFLUXDB_DB", "esp32_data")) # Default database name
POLL_INTERVAL: int = int(
os.getenv("POLL_INTERVAL", 2)
) # Default polling interval to 2 seconds

# InfluxDB client setup
client = InfluxDBClient(host=INFLUXDB_HOST, port=INFLUXDB_PORT)
Expand Down

0 comments on commit dfec885

Please sign in to comment.