This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Set door codes webhook | |
description: > | |
Webhook that sets a door code slot on multiple lock entities using set_usercode. | |
IMPORTANT: When setting up this automation, click the gear icon beside the Webhook ID | |
to choose whether the webhook is 'Only accessible from the local network'. | |
domain: automation | |
input: | |
secret_token: | |
name: Secret Token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import re | |
import os | |
def get_battery_health(): | |
# Run the system_profiler command to get battery information | |
result = subprocess.run(["/usr/sbin/system_profiler", "SPPowerDataType"], capture_output=True, text=True) | |
output = result.stdout |