From c909f0c22141f175aa408ce23f0a6fdd287e1d1a Mon Sep 17 00:00:00 2001 From: Denys Dovhan Date: Thu, 17 Oct 2024 16:58:03 +0300 Subject: [PATCH] new groups for docs --- helpers/update_content.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/helpers/update_content.py b/helpers/update_content.py index c59ec35..0305b79 100755 --- a/helpers/update_content.py +++ b/helpers/update_content.py @@ -14,6 +14,21 @@ MANIFEST = "manifest.json" URL = "https://github.com/denysdovhan/home-assistant-config/blob/{commit_hash}/{fname}" +GROUPS_EMOJIS = { + "Alarm": "๐Ÿšจ", + "Alert": "๐Ÿ””", + "Climate": "๐ŸŒก๏ธ", + "Curtains": "๐ŸŒ†", + "Energy": "โšก๏ธ", + "Presence": "๐Ÿ”˜", + "Light": "๐Ÿ’ก", + "Media": "๐ŸŽต", + "Mode": "๐Ÿšฆ", + "System": "๐Ÿ–ฅ๏ธ", + "Vacuum": "๐Ÿงน", + "Water": "๐Ÿ’ฆ", +} + def git_latest_edit_hash(filename): """Get the git hash to save with data to ensure reproducibility.""" git_output = subprocess.check_output( @@ -28,20 +43,7 @@ def to_file(lines): return "".join(lines) def get_emoji(group): - emojis = { - "Alarm": "๐Ÿšจ", - "Alert": "๐Ÿ””", - "Climate": "๐ŸŒก๏ธ", - "Energy": "โšก๏ธ", - "Presence": "๐Ÿ”˜", - "Light": "๐Ÿ’ก", - "Media": "๐ŸŽต", - "Mode": "๐Ÿšฆ", - "System": "๐Ÿ–ฅ๏ธ", - "Vacuum": "๐Ÿงน", - "Water": "๐Ÿ’ฆ", - } - return emojis.get(group, "โš™๏ธ") + return GROUPS_EMOJIS.get(group, "โš™๏ธ") def read_file(fname): with open(fname) as file: