From bd694e872853d0df204e2dd0854885ddcabf35f6 Mon Sep 17 00:00:00 2001 From: zsmithwx Date: Thu, 2 May 2024 00:09:41 -0500 Subject: [PATCH] Update temp.py --- temp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/temp.py b/temp.py index 0d0a1f1..2a43bc3 100644 --- a/temp.py +++ b/temp.py @@ -5,7 +5,7 @@ from datetime import datetime, timedelta import pytz # Fetch data from NOAA Radar API -response = requests.get('https://api.weather.gov/radar/stations/SITE') +response = requests.get('https://api.weather.gov/radar/stations/KBIS') data = response.json() # Extract relevant information @@ -27,7 +27,7 @@ measurement = 'radar_station' time = current_time.isoformat() # Create InfluxDB client -client = InfluxDBClient(url="", token="", org="") +client = InfluxDBClient(url="http://10.10.3.212:8086", token="TOKEN GOES HERE", org="ORG NAME HERE") # Create write API write_api = client.write_api(write_options=SYNCHRONOUS) @@ -49,7 +49,7 @@ fields = { "data_age_minutes": data_age, # Check if volume_coverage_pattern starts with 'R' or 'L', remove prefix if exists and convert to float - "vcp": float(str(radar_data["rda"]["properties"]["volumeCoveragePattern"])[1:]) if str(radar_data["rda"]["properties"]["volumeCoveragePattern"]).startswith('R') or str(radar_data["rda"]["properties"]["volumeCoveragePattern"]).startswith('L') else float(rad> + "vcp": float(str(radar_data["rda"]["properties"]["volumeCoveragePattern"])[1:]) if str(radar_data["rda"]["properties"]["volumeCoveragePattern"]).startswith('R') or str(radar_data["rda"]["properties"]["volumeCoveragePattern"]).startswith('L') else float(radar_data["rda"]["properties"]["volumeCoveragePattern"]), # Add more fields as needed } @@ -58,4 +58,4 @@ fields = { point = Point(measurement).time(time).tag("id", radar_data["id"]) for field, value in fields.items(): point.field(field, value) -write_api.write("Bucket", "Org", point) \ No newline at end of file +write_api.write("BUCKET NAME HERE", "ORG NAME HERE", point)