Skip to content

Commit

Permalink
new groups for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdovhan committed Oct 17, 2024
1 parent 9ff2a36 commit c909f0c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions helpers/update_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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:
Expand Down

0 comments on commit c909f0c

Please # to comment.