0.7.1: i tasti delle azioni rapide dichiarano la loro altezza
In Silica il tasto piglia l'altezza dal tema (itemSizeExtraSmall, ~56 px) e non dal contenuto: con icona e etichetta (~110) il testo usciva dalla scatola e la riga di contorno della colonna finiva sopra le etichette. Ora height: Theme.itemSizeMedium. Aggiunto il controllo in tests/label_fit_check.py e il registro di posizione e altezza di ogni riga della Home.
This commit is contained in:
@@ -58,7 +58,7 @@ CREDS = BASE / "aira.json"
|
||||
TOKENS = BASE / "aira_tokens.json"
|
||||
POOL_CFG = BASE / "aira_config.json"
|
||||
|
||||
VERSION = "0.7.0"
|
||||
VERSION = "0.7.1"
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
@@ -693,6 +693,12 @@ def boost_restanti(st: dict) -> int:
|
||||
quando = datetime.fromisoformat(fine.replace("Z", "+00:00"))
|
||||
except ValueError:
|
||||
return 0
|
||||
# L'impianto manda la fine del boost ora con il fuso, ora senza (ora
|
||||
# locale): senza, va letta nel fuso dell'IMPIANTO, altrimenti la
|
||||
# sottrazione con "adesso" (che il fuso ce l'ha) solleva TypeError e
|
||||
# /summary risponde 502 -- l'app resta senza dati ("Nessun dato").
|
||||
if quando.tzinfo is None:
|
||||
quando = quando.replace(tzinfo=PLANT_TZ)
|
||||
return max(0, int((quando - datetime.now(timezone.utc)).total_seconds()))
|
||||
|
||||
|
||||
|
||||
@@ -231,6 +231,18 @@ check("boost in corso: restano ~1200 secondi",
|
||||
check("boost finito: zero secondi",
|
||||
b.boost_restanti({"hot_water_boost": {"end_time": "2026-01-01T00:00:00Z"}}) == 0)
|
||||
check("boost mai avviato: zero secondi", b.boost_restanti({}) == 0)
|
||||
|
||||
# L'impianto puo' mandare la fine del boost SENZA fuso (ora locale). E' la forma
|
||||
# che ha fatto rispondere 502 a /summary: la sottrazione con "adesso" (che il
|
||||
# fuso ce l'ha) solleva TypeError, e l'app resta senza dati ("Nessun dato").
|
||||
# Il conto alla rovescia deve reggere entrambe le forme.
|
||||
_fine_naive = (datetime.now(b.PLANT_TZ) + timedelta(seconds=1200)).strftime("%Y-%m-%dT%H:%M:%S")
|
||||
check("boost con fine senza fuso (ora dell'impianto)",
|
||||
abs(b.boost_restanti({"hot_water_boost": {"end_time": _fine_naive}}) - 1200) <= 3)
|
||||
check("riassunto con fine senza fuso (la forma che dava 502)",
|
||||
(b.summarize({"hot_water_boost": {"end_time": _fine_naive}}) or {}).get("boost_active") is True)
|
||||
check("boost con fine fuori orario (fuso diverso)",
|
||||
b.boost_restanti({"hot_water_boost": {"end_time": "2020-01-01T00:00:00"}}) == 0)
|
||||
riassunto = b.summarize({"hot_water_boost": {"end_time": fra}})
|
||||
check("riassunto: dice che il boost e' in corso", riassunto.get("boost_active") is True)
|
||||
check("riassunto: porta i secondi del boost",
|
||||
|
||||
Reference in New Issue
Block a user