Add integration icon

Home Assistant 2026.3+ shows custom integrations' own brand images from
custom_components/<domain>/brand/. Add a radiator with a forecast curve
(solid past, "now" marker, dashed prediction) as icon.png/icon@2x.png
(256/512 px, transparent) plus dark-theme variants, so the integration
is easy to spot in Devices & services. Older HA versions ignore the
folder and show the generic placeholder; the integration is unaffected.

scripts/make_brand_icons.py regenerates the images with Pillow from the
test requirements; the package check verifies sizes and transparency.
Listed under 0.2.3, which has not been deployed yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
buzeraandClaude Opus 5.5 committed 2026-10-26 22:13:20 +02:00
1 parent c79fdbd71b
commit ec3a0738fe
8 files changed
+123 -1

No files matched your search

+10 -1
View File
@@ -1,6 +1,7 @@
"""Small local packaging and translation checks; not a replacement for hassfest."""
import json
from pathlib import Path
import struct
import subprocess
root = Path(__file__).resolve().parents[1]
@@ -26,6 +27,14 @@ strings = json.loads((component / "strings.json").read_text())
for language in ("en", "ro"):
translated = json.loads((component / "translations" / f"{language}.json").read_text())
assert keys(strings) == keys(translated), f"Translation keys differ: {language}"
# Brand icons (HA 2026.3+): square transparent PNGs; see scripts/make_brand_icons.py.
for name, size in (("icon.png", 256), ("icon@2x.png", 512),
("dark_icon.png", 256), ("dark_icon@2x.png", 512)):
png = (component / "brand" / name).read_bytes()
assert png[:8] == b"\x89PNG\r\n\x1a\n" and png[12:16] == b"IHDR", f"{name} is not a PNG"
width, height, _depth, color_type = struct.unpack(">IIBB", png[16:26])
assert (width, height) == (size, size), f"{name} is {width}x{height}, expected {size}x{size}"
assert color_type == 6, f"{name} needs an alpha channel"
tracked = subprocess.check_output(["git", "ls-files", "custom_components"], cwd=root, text=True).splitlines()
assert not any("__pycache__" in path or path.endswith((".pyc", ".pyo")) for path in tracked)
print("Package metadata, translations and tracked component files passed")
print("Package metadata, translations, brand icons and tracked component files passed")