Files
esphome/script/extract_automations.py

21 lines
585 B
Python
Executable File

#!/usr/bin/env python3
import json
from helpers import get_all_component_files, get_components_with_dependencies
from esphome.automation import ACTION_REGISTRY, CONDITION_REGISTRY
from esphome.pins import PIN_SCHEMA_REGISTRY
if __name__ == "__main__":
files = get_all_component_files()
components = get_components_with_dependencies(files, True)
dump = {
"actions": sorted(ACTION_REGISTRY.keys()),
"conditions": sorted(CONDITION_REGISTRY.keys()),
"pin_providers": sorted(PIN_SCHEMA_REGISTRY.keys()),
}
print(json.dumps(dump, indent=2))