Skip to content

Commit

Permalink
Fix YAML loading for analytic files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiacrumpton authored Feb 29, 2024
1 parent fefb198 commit 60d39f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/generate_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def generateSensorsForAnalytics(analytics, sensor_dict):

# Get all analytics and load as list of dicts
analytics_files = glob.glob(path.join(path.dirname(__file__), "..", "analytics", "*.yaml"))
analytics = [yaml.load(open(analytic_file).read()) for analytic_file in analytics_files]
with open(analytic_file) as af:
analytic_data = yaml.safe_load(af)
analytics.append(analytic_data)
#analytics = [yaml.load(open(analytic_file).read()) for analytic_file in analytics_files]

# Get all sensor mappings and load as a list of dicts
mapping_files = glob.glob(path.join(path.dirname(__file__), "..", "sensors", "*.yaml"))
Expand Down

0 comments on commit 60d39f3

Please sign in to comment.