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,
|
||||
)
|
||||
|
||||
# ── WarmNews Farbpalette ────────────────────────────────────────────────────
|
||||
# Hintergrund: ECHTES WEISS (255,255,255) für ACeP-Display.
|
||||
# Auf ACeP wird warm-creme als nicht-weiss gerendert und sieht verfärbt aus.
|
||||
PAPER_BG = (255, 255, 255) # echtes weiss
|
||||
INK = ( 18, 12, 8)
|
||||
INK_MID = (110, 110, 110)
|
||||
INK_LIGHT = (200, 200, 200)
|
||||
FAINT = (230, 230, 230)
|
||||
RED = (200, 50, 40)
|
||||
GREEN = ( 50, 120, 60)
|
||||
BLUE = ( 60, 70, 160)
|
||||
INFO_BL = ( 50, 100, 160)
|
||||
PURPLE = (100, 80, 150)
|
||||
YELLOW = (200, 160, 40)
|
||||
# ── ACeP Native Farbpalette ───────────────────────────────────────────────────
|
||||
# ACeP 7.3" hat 7 Farben. Alles andere wird gedithert → matschig.
|
||||
# Hex (RGB): BLACK, WHITE, GREEN, BLUE, RED, YELLOW, ORANGE
|
||||
PAPER_BG = (255, 255, 255) # WHITE — echter Display-Hintergrund
|
||||
INK = ( 0, 0, 0) # BLACK — Text
|
||||
INK_MID = ( 0, 0, 0) # BLACK (kann nicht grau — entweder schwarz oder nichts)
|
||||
INK_LIGHT = ( 0, 0, 0) # BLACK, aber kleinere Schrift für Hierarchie
|
||||
FAINT = ( 0, 0, 0) # BLACK, dünner Strich
|
||||
RED = (255, 0, 0) # RED — Alerts, Indoor-Akzent
|
||||
GREEN = ( 0, 255, 0) # GREEN — Aussen, CO2 OK, Batt OK
|
||||
BLUE = ( 0, 0, 255) # BLUE — Wind, Regen, Forecast
|
||||
INFO_BL = ( 0, 0, 255) # BLUE
|
||||
PURPLE = ( 0, 0, 255) # BLUE (kein Magenta in Palette — nimm Blue)
|
||||
YELLOW = (255, 255, 0) # YELLOW — Forecast Sonne, Trend up
|
||||
ORANGE = (255, 128, 0) # ORANGE — Batt MID, Trend warn
|
||||
|
||||
BATT_LOW = (200, 50, 40)
|
||||
BATT_MID = (220, 160, 30)
|
||||
BATT_OK = (60, 140, 80)
|
||||
BATT_LOW = (255, 0, 0) # RED
|
||||
BATT_MID = (255, 128, 0) # ORANGE
|
||||
BATT_OK = ( 0, 255, 0) # GREEN
|
||||
|
||||
# ── Layout-Konstanten ─────────────────────────────────────────────────────
|
||||
PAD_OUTER = 14
|
||||
@@ -303,11 +304,11 @@ class Widget(Widget):
|
||||
|
||||
# ── Voll-Layout (4x4 = 800x480) ─────────────────────────────────────
|
||||
def _render_full(self, draw, x, y, w, h, d):
|
||||
# Spalten-Berechnung
|
||||
# Spalten-Berechnung — Indoor priorisiert (5 Sensoren)
|
||||
total_w = w - 2 * PAD_OUTER
|
||||
col_aussen = int(total_w * 0.36)
|
||||
col_mitte = int(total_w * 0.20)
|
||||
col_indoor = int(total_w * 0.24)
|
||||
col_indoor = int(total_w * 0.32) # mehr Platz für 5 Sensoren
|
||||
col_aussen = int(total_w * 0.28) # kompakter
|
||||
col_mitte = int(total_w * 0.18) # Wind+Regen schmal
|
||||
col_fc = total_w - col_aussen - col_mitte - col_indoor - 3 * GAP
|
||||
xa = x + PAD_OUTER
|
||||
xm = xa + col_aussen + GAP
|
||||
@@ -379,10 +380,10 @@ class Widget(Widget):
|
||||
SAFE_PAD = 20
|
||||
big_text = f"{out['data'].get('Temperature', 0):.0f}°"
|
||||
big_y = y + STRIP_H + LABEL_H
|
||||
big_h = 150
|
||||
big_h = 130
|
||||
font_big = self._fit_size(draw, big_text,
|
||||
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)
|
||||
draw.text((x + (w - bw) // 2, big_y + (big_h - bh) // 2),
|
||||
big_text, font=font_big, fill=INK)
|
||||
|
||||
Reference in New Issue
Block a user