- Carte servie et chargée par l'intégration (plus de copie dans www/ ni de ressource Lovelace) - Température de couleur en kelvins (ATTR_COLOR_TEMP supprimé de HA 2026.1), anciens préréglages convertis - get_presets déclarée avec réponse - manifest (URLs, dépendances), hacs.json, icône, .a2m/type_attributes.toml, scripts/package.py - README et CHANGELOG FR/EN, LICENSE MIT, CLAUDE.md et skill de publication - Fichiers de Home Assistant de dev retirés du suivi, .gitignore revu Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.5 KiB
Python
38 lines
1.5 KiB
Python
"""Construit dist/light_preset_manager-X.Y.Z.zip : le contenu de custom_components/light_preset_manager/ (pièce jointe de rôle download).
|
|
|
|
La version est celle de manifest.json. Le zip se décompresse dans config/custom_components/light_preset_manager/.
|
|
Usage : python scripts/package.py
|
|
"""
|
|
|
|
import json
|
|
import sys
|
|
import zipfile
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parent.parent
|
|
SOURCE = ROOT / "custom_components" / "light_preset_manager"
|
|
EXCLUDED = {"__pycache__", ".pytest_cache"}
|
|
|
|
|
|
def main() -> int:
|
|
manifest = json.loads((SOURCE / "manifest.json").read_text(encoding="utf-8"))
|
|
if manifest["domain"] != SOURCE.name:
|
|
print(f"manifest.json : domain « {manifest['domain']} » différent du dossier « {SOURCE.name} »")
|
|
return 1
|
|
card = SOURCE / "frontend" / "light-preset-manager.js"
|
|
if not card.is_file():
|
|
print(f"{card.relative_to(ROOT)} absent : lancer « npm run build » dans frontend/")
|
|
return 1
|
|
target = ROOT / "dist" / f"{SOURCE.name}-{manifest['version']}.zip"
|
|
target.parent.mkdir(exist_ok=True)
|
|
with zipfile.ZipFile(target, "w", zipfile.ZIP_DEFLATED) as archive:
|
|
for path in sorted(SOURCE.rglob("*")):
|
|
if path.is_file() and not EXCLUDED & set(path.relative_to(SOURCE).parts) and path.suffix not in {".pyc", ".map"}:
|
|
archive.write(path, path.relative_to(SOURCE).as_posix())
|
|
print(target.relative_to(ROOT).as_posix())
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|