From 621eccbf0ab3c89c7c60cd6d3a1b76e46f41f1b1 Mon Sep 17 00:00:00 2001 From: Jeremy M Crews Date: Wed, 3 Jul 2024 14:05:08 -0700 Subject: [PATCH] testing 10 --- .../binary_sensor_notifications_plus.yaml | 1 - scripts/yaml_to_markdown.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/automations/binary_sensor_notifications_plus/binary_sensor_notifications_plus.yaml b/automations/binary_sensor_notifications_plus/binary_sensor_notifications_plus.yaml index 430c05c..00b160c 100644 --- a/automations/binary_sensor_notifications_plus/binary_sensor_notifications_plus.yaml +++ b/automations/binary_sensor_notifications_plus/binary_sensor_notifications_plus.yaml @@ -176,4 +176,3 @@ action: mode: single max_exceeded: silent - diff --git a/scripts/yaml_to_markdown.py b/scripts/yaml_to_markdown.py index 769deff..f83262f 100644 --- a/scripts/yaml_to_markdown.py +++ b/scripts/yaml_to_markdown.py @@ -67,9 +67,14 @@ def yaml_to_markdown(yaml_file, markdown_file): # Handle other types of actions if necessary pass - f.write("\n## Mode\n") - f.write(f"- **Mode**: {data['mode']}\n") - f.write(f"- **Max Exceeded**: {data['max_exceeded']}\n") + # Make mode optional + mode = data.get('mode', 'Not specified') + f.write(f"\n## Mode\n") + f.write(f"- **Mode**: {mode}\n") + + # Handle max_exceeded if present + max_exceeded = data.get('max_exceeded', 'Not specified') + f.write(f"- **Max Exceeded**: {max_exceeded}\n") if __name__ == "__main__": yaml_file = sys.argv[1]