FIX-NETATMO-05: ACeP Native-Farben + bessere Spalten-Verhaeltnisse
* Farben auf ACeP 7-Farben-Palette gemappt: BLACK, WHITE, GREEN, BLUE, RED, YELLOW, ORANGE (PIL.quantize dithert sonst alles in matschige Mischfarben) * Background PAPER_BG = (255,255,255) echtes Weiss statt warm-creme * Spalten-Verhaeltnis neu: Indoor 32% (mehr Platz fuer 5 Sensoren), Aussen 28%, Mitte 18%, Forecast 22% * Big-Temp candidates von [150,130,110,95] auf [120,100,85,72,60] reduziert * FAINT und INK_LIGHT als BLACK definiert (Grautöne ergeben Mischpixel) * Funktioniert mit echten Daten: zeigt 5 Indoor-Sensoren + alle Aussensensoren
This commit is contained in:
+24
-23
@@ -26,24 +26,25 @@ from palette import (
|
|||||||
measure, fit_font, is_small, is_wide, is_tall,
|
measure, fit_font, is_small, is_wide, is_tall,
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── WarmNews Farbpalette ────────────────────────────────────────────────────
|
# ── ACeP Native Farbpalette ───────────────────────────────────────────────────
|
||||||
# Hintergrund: ECHTES WEISS (255,255,255) für ACeP-Display.
|
# ACeP 7.3" hat 7 Farben. Alles andere wird gedithert → matschig.
|
||||||
# Auf ACeP wird warm-creme als nicht-weiss gerendert und sieht verfärbt aus.
|
# Hex (RGB): BLACK, WHITE, GREEN, BLUE, RED, YELLOW, ORANGE
|
||||||
PAPER_BG = (255, 255, 255) # echtes weiss
|
PAPER_BG = (255, 255, 255) # WHITE — echter Display-Hintergrund
|
||||||
INK = ( 18, 12, 8)
|
INK = ( 0, 0, 0) # BLACK — Text
|
||||||
INK_MID = (110, 110, 110)
|
INK_MID = ( 0, 0, 0) # BLACK (kann nicht grau — entweder schwarz oder nichts)
|
||||||
INK_LIGHT = (200, 200, 200)
|
INK_LIGHT = ( 0, 0, 0) # BLACK, aber kleinere Schrift für Hierarchie
|
||||||
FAINT = (230, 230, 230)
|
FAINT = ( 0, 0, 0) # BLACK, dünner Strich
|
||||||
RED = (200, 50, 40)
|
RED = (255, 0, 0) # RED — Alerts, Indoor-Akzent
|
||||||
GREEN = ( 50, 120, 60)
|
GREEN = ( 0, 255, 0) # GREEN — Aussen, CO2 OK, Batt OK
|
||||||
BLUE = ( 60, 70, 160)
|
BLUE = ( 0, 0, 255) # BLUE — Wind, Regen, Forecast
|
||||||
INFO_BL = ( 50, 100, 160)
|
INFO_BL = ( 0, 0, 255) # BLUE
|
||||||
PURPLE = (100, 80, 150)
|
PURPLE = ( 0, 0, 255) # BLUE (kein Magenta in Palette — nimm Blue)
|
||||||
YELLOW = (200, 160, 40)
|
YELLOW = (255, 255, 0) # YELLOW — Forecast Sonne, Trend up
|
||||||
|
ORANGE = (255, 128, 0) # ORANGE — Batt MID, Trend warn
|
||||||
|
|
||||||
BATT_LOW = (200, 50, 40)
|
BATT_LOW = (255, 0, 0) # RED
|
||||||
BATT_MID = (220, 160, 30)
|
BATT_MID = (255, 128, 0) # ORANGE
|
||||||
BATT_OK = (60, 140, 80)
|
BATT_OK = ( 0, 255, 0) # GREEN
|
||||||
|
|
||||||
# ── Layout-Konstanten ─────────────────────────────────────────────────────
|
# ── Layout-Konstanten ─────────────────────────────────────────────────────
|
||||||
PAD_OUTER = 14
|
PAD_OUTER = 14
|
||||||
@@ -303,11 +304,11 @@ class Widget(Widget):
|
|||||||
|
|
||||||
# ── Voll-Layout (4x4 = 800x480) ─────────────────────────────────────
|
# ── Voll-Layout (4x4 = 800x480) ─────────────────────────────────────
|
||||||
def _render_full(self, draw, x, y, w, h, d):
|
def _render_full(self, draw, x, y, w, h, d):
|
||||||
# Spalten-Berechnung
|
# Spalten-Berechnung — Indoor priorisiert (5 Sensoren)
|
||||||
total_w = w - 2 * PAD_OUTER
|
total_w = w - 2 * PAD_OUTER
|
||||||
col_aussen = int(total_w * 0.36)
|
col_indoor = int(total_w * 0.32) # mehr Platz für 5 Sensoren
|
||||||
col_mitte = int(total_w * 0.20)
|
col_aussen = int(total_w * 0.28) # kompakter
|
||||||
col_indoor = int(total_w * 0.24)
|
col_mitte = int(total_w * 0.18) # Wind+Regen schmal
|
||||||
col_fc = total_w - col_aussen - col_mitte - col_indoor - 3 * GAP
|
col_fc = total_w - col_aussen - col_mitte - col_indoor - 3 * GAP
|
||||||
xa = x + PAD_OUTER
|
xa = x + PAD_OUTER
|
||||||
xm = xa + col_aussen + GAP
|
xm = xa + col_aussen + GAP
|
||||||
@@ -379,10 +380,10 @@ class Widget(Widget):
|
|||||||
SAFE_PAD = 20
|
SAFE_PAD = 20
|
||||||
big_text = f"{out['data'].get('Temperature', 0):.0f}°"
|
big_text = f"{out['data'].get('Temperature', 0):.0f}°"
|
||||||
big_y = y + STRIP_H + LABEL_H
|
big_y = y + STRIP_H + LABEL_H
|
||||||
big_h = 150
|
big_h = 130
|
||||||
font_big = self._fit_size(draw, big_text,
|
font_big = self._fit_size(draw, big_text,
|
||||||
w - 2 * SAFE_PAD, big_h - 8,
|
w - 2 * SAFE_PAD, big_h - 8,
|
||||||
candidates=["150", "130", "110", "95"])
|
candidates=["120", "100", "85", "72", "60"])
|
||||||
bw, bh = measure(draw, big_text, font_big)
|
bw, bh = measure(draw, big_text, font_big)
|
||||||
draw.text((x + (w - bw) // 2, big_y + (big_h - bh) // 2),
|
draw.text((x + (w - bw) // 2, big_y + (big_h - bh) // 2),
|
||||||
big_text, font=font_big, fill=INK)
|
big_text, font=font_big, fill=INK)
|
||||||
|
|||||||
Reference in New Issue
Block a user