2019-04-04 06:46:06 +00:00
|
|
|
"""Helpers to deal with manifests."""
|
|
|
|
import json
|
|
|
|
import pathlib
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
component_dir = pathlib.Path("homeassistant/components")
|
2019-04-04 06:46:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
def iter_manifests():
|
|
|
|
"""Iterate over all available manifests."""
|
|
|
|
manifests = [
|
2019-07-31 19:25:30 +00:00
|
|
|
json.loads(fil.read_text()) for fil in component_dir.glob("*/manifest.json")
|
2019-04-04 06:46:06 +00:00
|
|
|
]
|
2019-07-31 19:25:30 +00:00
|
|
|
return sorted(manifests, key=lambda man: man["domain"])
|