From a7dedb3366a37fb0e565c4ba882988c4fd2e4d94 Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Wed, 3 Jun 2026 15:42:04 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20badges=20origine=20centralis=C3=A9s,=20?= =?UTF-8?q?TOC=20masqu=C3=A9=20sur=20les=20index=20de=20cat=C3=A9gorie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - render_header_badges() fonction partagée pour canal + origine + stabilité - Marqueur __badges___ dans les 9 fiches (5 manuelles + 4 auto) - Marqueur __index___ dans les 3 index manuels (compteurs, bornes, smart) - Front matter hide: [toc] sur tous les index de catégorie - .badge.experimental ajouté dans extra.css (waveshare) - process() gère __badges_ keys via render_header_badges() - build_category_index_page() inclut hide:toc front matter Co-Authored-By: Claude Sonnet 4.6 --- docs/appareils/bornes/abb-terra.md | 5 +++- docs/appareils/bornes/index.md | 27 ++++++++++++++++--- docs/appareils/bornes/keba.md | 5 +++- docs/appareils/compatibilite.md | 2 +- docs/appareils/compteurs/abb-b2x.md | 5 +++- docs/appareils/compteurs/eastron.md | 5 +++- docs/appareils/compteurs/index.md | 22 ++++++++++++--- docs/appareils/generic/index.md | 5 ++++ docs/appareils/hvac/daikinairco.md | 5 +++- docs/appareils/hvac/index.md | 5 ++++ docs/appareils/hvac/sgready.md | 5 +++- docs/appareils/hvac/simpleheatpump.md | 5 +++- docs/appareils/onduleurs/fronius.md | 5 +++- docs/appareils/onduleurs/index.md | 5 ++++ docs/appareils/smart/index.md | 23 +++++++++++++--- docs/appareils/smart/waveshare.md | 5 +++- docs/appareils/tarifs/index.md | 5 ++++ docs/stylesheets/extra.css | 5 ++-- scripts/gen_device_reference.py | 39 ++++++++++++++++++--------- 19 files changed, 148 insertions(+), 35 deletions(-) diff --git a/docs/appareils/bornes/abb-terra.md b/docs/appareils/bornes/abb-terra.md index cfdb419..1897aa1 100644 --- a/docs/appareils/bornes/abb-terra.md +++ b/docs/appareils/bornes/abb-terra.md @@ -1,6 +1,9 @@ # Borne ABB Terra AC -TESTING CONSUMER + +TESTING ETM CONSUMER + + La borne de recharge ABB Terra AC existe en deux variantes de communication : **Modbus TCP** (réseau Ethernet/LAN) et **Modbus RTU** (bus RS485). diff --git a/docs/appareils/bornes/index.md b/docs/appareils/bornes/index.md index ffaebfd..0262d3a 100644 --- a/docs/appareils/bornes/index.md +++ b/docs/appareils/bornes/index.md @@ -1,8 +1,27 @@ +--- +hide: + - toc +--- + # Bornes de recharge Bornes EVSE intégrées dans ETM PowerSync pour la recharge pilotée des véhicules électriques. -| Appareil | Protocole | Canal | Stabilité | -|---|---|---|---| -| [Borne ABB Terra AC](abb-terra.md) | Modbus TCP / RTU | TESTING | CONSUMER | -| [Keba](keba.md) | Modbus TCP | NIGHTLY | COMMUNITY | + +| Appareil | Protocole | Canal | Origine | Stabilité | +| --- | --- | --- | --- | --- | +| [Borne ABB Terra AC](abb-terra.md) | Modbus TCP | TESTING | ETM | CONSUMER | +| [Keba](keba.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [Easeex](easee.md) | — | NIGHTLY | NYMEA | CONSUMER | +| [go-eCharger](goecharger.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [EVBox](evbox.md) | — | NIGHTLY | NYMEA | CONSUMER | +| [EVerest](everest.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [v2xeamberelectric](v2xeamberelectric.md) | — | NIGHTLY | NYMEA | — | +| [Amperfied](amperfied.md) | Modbus RTU | NIGHTLY | NYMEA | CONSUMER | +| [MENNEKES](mennekes.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [webasto](webasto.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [PC Electric](pcelectric.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [PhoenixConnect](phoenixconnect.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [INRO](inro.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | + + diff --git a/docs/appareils/bornes/keba.md b/docs/appareils/bornes/keba.md index 31c6739..5764585 100644 --- a/docs/appareils/bornes/keba.md +++ b/docs/appareils/bornes/keba.md @@ -1,6 +1,9 @@ # Keba -NIGHTLY COMMUNITY + +NIGHTLY NYMEA CONSUMER + + Bornes de recharge Keba (séries P30, P31), communication **Modbus TCP** via réseau local. diff --git a/docs/appareils/compatibilite.md b/docs/appareils/compatibilite.md index 94f82b2..77d5b57 100644 --- a/docs/appareils/compatibilite.md +++ b/docs/appareils/compatibilite.md @@ -64,7 +64,7 @@ Chaque appareil porte trois badges indépendants : | Marque / Modèle | Protocole | Canal | Origine | Stabilité | |---|---|---|---|---| -| Waveshare relais | Modbus RTU | TESTING | ETM | — | +| Waveshare relais | Modbus RTU | TESTING | ETM | EXPERIMENTAL | | Shelly | — | NIGHTLY | NYMEA | CONSUMER | | Tasmota | — | NIGHTLY | NYMEA | COMMUNITY | | Tuya | — | NIGHTLY | NYMEA | COMMUNITY | diff --git a/docs/appareils/compteurs/abb-b2x.md b/docs/appareils/compteurs/abb-b2x.md index 5382378..aeafd78 100644 --- a/docs/appareils/compteurs/abb-b2x.md +++ b/docs/appareils/compteurs/abb-b2x.md @@ -1,6 +1,9 @@ # Compteur ABB B2x -TESTING CONSUMER + +TESTING ETM CONSUMER + + Le compteur d'énergie ABB B2x communique en **Modbus RTU** sur le bus RS485 du hub. Mesure triphasée (tensions, courants et puissances par phase). diff --git a/docs/appareils/compteurs/eastron.md b/docs/appareils/compteurs/eastron.md index c74466e..ce187c2 100644 --- a/docs/appareils/compteurs/eastron.md +++ b/docs/appareils/compteurs/eastron.md @@ -1,6 +1,9 @@ # Compteurs Eastron (SDM) -STABLE CONSUMER + +STABLE ETM CONSUMER + + Les compteurs Eastron de la série SDM (SDM72, SDM120, SDM220, SDM230, SDM630) communiquent en **Modbus RTU** sur le bus RS485 du hub. Selon le modèle, ils diff --git a/docs/appareils/compteurs/index.md b/docs/appareils/compteurs/index.md index 26b714a..c6b498f 100644 --- a/docs/appareils/compteurs/index.md +++ b/docs/appareils/compteurs/index.md @@ -1,8 +1,22 @@ +--- +hide: + - toc +--- + # Compteurs Compteurs d'énergie supportés par ETM PowerSync via Modbus RTU. -| Appareil | Protocole | Canal | Stabilité | -|---|---|---|---| -| [Eastron SDM](eastron.md) | Modbus RTU | STABLE | CONSUMER | -| [Compteur ABB B2x](abb-b2x.md) | Modbus RTU | TESTING | CONSUMER | + +| Appareil | Protocole | Canal | Origine | Stabilité | +| --- | --- | --- | --- | --- | +| [Eastron SDM](eastron.md) | Modbus RTU | STABLE | ETM | CONSUMER | +| [Compteur ABB B2x](abb-b2x.md) | Modbus RTU | TESTING | ETM | CONSUMER | +| [powerfox](powerfox.md) | — | NIGHTLY | NYMEA | CONSUMER | +| [B+G E-Tech](bgetech.md) | Modbus RTU | NIGHTLY | NYMEA | CONSUMER | +| [inepro Metering](inepro.md) | Modbus RTU | NIGHTLY | NYMEA | CONSUMER | +| [Schrack](schrack.md) | Modbus RTU | NIGHTLY | NYMEA | CONSUMER | +| [Bestel](vestel.md) | Modbus TCP | NIGHTLY | NYMEA | CONSUMER | +| [Senseair](senseair.md) | Modbus RTU | NIGHTLY | NYMEA | CONSUMER | + + diff --git a/docs/appareils/generic/index.md b/docs/appareils/generic/index.md index 17c0bbf..541cde4 100644 --- a/docs/appareils/generic/index.md +++ b/docs/appareils/generic/index.md @@ -1,3 +1,8 @@ +--- +hide: + - toc +--- + # Types génériques diff --git a/docs/appareils/hvac/daikinairco.md b/docs/appareils/hvac/daikinairco.md index dfcf4e4..8efa271 100644 --- a/docs/appareils/hvac/daikinairco.md +++ b/docs/appareils/hvac/daikinairco.md @@ -1,6 +1,9 @@ # Daikin -NIGHTLY + +NIGHTLY NYMEA COMMUNITY + + **Fabricant :** Daikin diff --git a/docs/appareils/hvac/index.md b/docs/appareils/hvac/index.md index f0bd56e..b8c49f6 100644 --- a/docs/appareils/hvac/index.md +++ b/docs/appareils/hvac/index.md @@ -1,3 +1,8 @@ +--- +hide: + - toc +--- + # HVAC diff --git a/docs/appareils/hvac/sgready.md b/docs/appareils/hvac/sgready.md index d0c4aae..8d048b5 100644 --- a/docs/appareils/hvac/sgready.md +++ b/docs/appareils/hvac/sgready.md @@ -1,6 +1,9 @@ # SG-Ready -NIGHTLY + +NIGHTLY NYMEA COMMUNITY + + **Fabricant :** nymea diff --git a/docs/appareils/hvac/simpleheatpump.md b/docs/appareils/hvac/simpleheatpump.md index c86faa0..c83f0f7 100644 --- a/docs/appareils/hvac/simpleheatpump.md +++ b/docs/appareils/hvac/simpleheatpump.md @@ -1,6 +1,9 @@ # SimpleHeatpump -NIGHTLY + +NIGHTLY NYMEA COMMUNITY + + **Fabricant :** nymea diff --git a/docs/appareils/onduleurs/fronius.md b/docs/appareils/onduleurs/fronius.md index 7d7dc1b..96a8262 100644 --- a/docs/appareils/onduleurs/fronius.md +++ b/docs/appareils/onduleurs/fronius.md @@ -1,6 +1,9 @@ # Fronius -NIGHTLY + +NIGHTLY NYMEA CONSUMER + + **Fabricant :** Fronius diff --git a/docs/appareils/onduleurs/index.md b/docs/appareils/onduleurs/index.md index 72c65eb..3ab46a4 100644 --- a/docs/appareils/onduleurs/index.md +++ b/docs/appareils/onduleurs/index.md @@ -1,3 +1,8 @@ +--- +hide: + - toc +--- + # Onduleurs / PV diff --git a/docs/appareils/smart/index.md b/docs/appareils/smart/index.md index f81cdee..0413bf8 100644 --- a/docs/appareils/smart/index.md +++ b/docs/appareils/smart/index.md @@ -1,7 +1,24 @@ +--- +hide: + - toc +--- + # SmartDevices Modules de pilotage de charges supportés par ETM PowerSync. -| Appareil | Protocole | Canal | Stabilité | -|---|---|---|---| -| [Waveshare relais](waveshare.md) | Modbus RTU | TESTING | CONSUMER | + +| Appareil | Protocole | Canal | Origine | Stabilité | +| --- | --- | --- | --- | --- | +| [Waveshare relais](waveshare.md) | Modbus RTU | TESTING | ETM | EXPERIMENTAL | +| [Shelly](shelly.md) | — | NIGHTLY | NYMEA | CONSUMER | +| [Tasmota](tasmota.md) | — | NIGHTLY | NYMEA | COMMUNITY | +| [Tuya](tuya.md) | — | NIGHTLY | NYMEA | COMMUNITY | +| [GPIO](gpio.md) | — | NIGHTLY | NYMEA | COMMUNITY | +| [USB Relay](usbrelay.md) | — | NIGHTLY | NYMEA | CONSUMER | +| [USB-RLY82](usbrly82.md) | — | NIGHTLY | NYMEA | CONSUMER | +| [MQTT client](mqttclient.md) | — | NIGHTLY | NYMEA | COMMUNITY | +| [Modbus Commander](modbuscommander.md) | Modbus TCP | NIGHTLY | NYMEA | COMMUNITY | +| [UniPi](unipi.md) | — | NIGHTLY | NYMEA | CONSUMER | + + diff --git a/docs/appareils/smart/waveshare.md b/docs/appareils/smart/waveshare.md index 9044404..dd91be9 100644 --- a/docs/appareils/smart/waveshare.md +++ b/docs/appareils/smart/waveshare.md @@ -1,6 +1,9 @@ # Waveshare relais -TESTING CONSUMER + +TESTING ETM EXPERIMENTAL + + Module de relais Waveshare (modèle 8 canaux RS485), pilotage via **Modbus RTU**. diff --git a/docs/appareils/tarifs/index.md b/docs/appareils/tarifs/index.md index 1bc1cc9..e22a154 100644 --- a/docs/appareils/tarifs/index.md +++ b/docs/appareils/tarifs/index.md @@ -1,3 +1,8 @@ +--- +hide: + - toc +--- + # Tarifs & prévisions diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 5f9916e..3083672 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -22,8 +22,9 @@ .badge.nightly {color:#8fa9b5;background:rgba(143,169,181,.1);border:1px solid rgba(143,169,181,.3)} /* stabilité plugin (meta.json) */ -.badge.consumer {color:#31a3dd;background:rgba(49,163,221,.1);border:1px solid rgba(49,163,221,.3)} -.badge.community {color:#a78bfa;background:rgba(167,139,250,.1);border:1px solid rgba(167,139,250,.3)} +.badge.consumer {color:#31a3dd;background:rgba(49,163,221,.1);border:1px solid rgba(49,163,221,.3)} +.badge.community {color:#a78bfa;background:rgba(167,139,250,.1);border:1px solid rgba(167,139,250,.3)} +.badge.experimental {color:#fb923c;background:rgba(251,146,60,.1);border:1px solid rgba(251,146,60,.3)} /* origine plugin (PORTING_STATUS.repo ou champ origin:) */ .badge.origin-nymea {color:#94a3b8;background:rgba(148,163,184,.1);border:1px solid rgba(148,163,184,.3)} diff --git a/scripts/gen_device_reference.py b/scripts/gen_device_reference.py index 7dde7f8..a2dbee3 100644 --- a/scripts/gen_device_reference.py +++ b/scripts/gen_device_reference.py @@ -78,8 +78,9 @@ CHANNEL_BADGES = { } STABILITY_BADGES = { - "consumer": 'CONSUMER', - "community": 'COMMUNITY', + "consumer": 'CONSUMER', + "community": 'COMMUNITY', + "experimental": 'EXPERIMENTAL', } ORIGIN_BADGES = { @@ -100,6 +101,16 @@ def resolve_origin(e: dict) -> str: return "etm" return "tiers" +def render_header_badges(e: dict, meta: dict) -> str: + """Rendu de la ligne de badges d'en-tête : canal, origine, stabilité.""" + channel_badge = CHANNEL_BADGES.get(e["channel"], e["channel"]) + origin_badge = ORIGIN_BADGES.get(resolve_origin(e), "") + stability = meta.get("stability", "") + stability_badge = STABILITY_BADGES.get(stability, "") if stability else "" + parts = [b for b in [channel_badge, origin_badge, stability_badge] if b] + return " ".join(parts) + "\n" + + MARKER_RE = re.compile( r"()(?P.*?)()", re.DOTALL, @@ -434,12 +445,10 @@ def build_device_page(e: dict, plugin_data: dict | None, meta: dict) -> str: plugin = e["plugin"] fname = f"integrationplugin{plugin}.json" - channel_badge = CHANNEL_BADGES.get(e["channel"], e["channel"]) - origin_badge = ORIGIN_BADGES.get(resolve_origin(e), "") - stability = meta.get("stability", "") - stability_badge = STABILITY_BADGES.get(stability, "") if stability else "" - badges_parts = [b for b in [channel_badge, origin_badge, stability_badge] if b] - badges_line = " ".join(badges_parts) + badges_gen = render_header_badges(e, meta) + badges_block = ( + f"\n{badges_gen}\n" + ) tagline = meta.get("tagline", "") if plugin_data: @@ -449,11 +458,9 @@ def build_device_page(e: dict, plugin_data: dict | None, meta: dict) -> str: file=sys.stderr) gen = render_nightly_stub(e, meta) - # Bloc BEGIN/END au format exact produit par process() : - # f"{m.group(1)}\n{gen}\n{m.group(4)}" avec gen qui se termine par \n block = f"\n{gen}\n" - header_parts = [f"# {title}", "", badges_line] + header_parts = [f"# {title}", "", badges_block] if tagline: header_parts += ["", tagline] header_parts.append("") # ligne vide avant le bloc BEGIN @@ -468,7 +475,7 @@ def build_category_index_page(cat: str, entries: list, plugins: dict, src: Path) gen = render_category_index(cat, entries, plugins, src) # Même format que process() : f"{m.group(1)}\n{gen}\n{m.group(4)}" block = f"\n{gen}\n" - return f"# {label}\n\n{block}\n" + return f"---\nhide:\n - toc\n---\n\n# {label}\n\n{block}\n" # ── Création des fichiers manquants ─────────────────────────────────────────── @@ -543,6 +550,14 @@ def process(docs: Path, entries: list, plugins: dict, src: Path, check: bool) -> key = m.group("key") if key == "__matrix__": gen = render_matrix(entries, plugins, src) + elif key.startswith("__badges_"): + plugin_name = key.removeprefix("__badges_").removesuffix("__") + entry = entry_by_plugin.get(plugin_name) + if not entry: + print(f" ! {md.name}: clé '{key}' plugin '{plugin_name}' inconnu", + file=sys.stderr) + return m.group(0) + gen = render_header_badges(entry, load_meta(src, plugin_name)) elif key.startswith("__index_"): # key = "__index___" → strip prefix "__index_" et suffix "__" cat = key.removeprefix("__index_").removesuffix("__")