cantabile_edge, cantabile_modbus, cantabile_eebus 0.1.400: full source

This commit is contained in:
Setti Solutions S.R.L committed 2026-10-30 08:26:45 +02:00
1 parent 343331d234
commit d5fbcacaa4
176 files changed
+32511 -19

No files matched your search

+142
View File
@@ -0,0 +1,142 @@
# Copyright © 2026 Setti Solutions S.R.L, www.setti.md. All rights reserved.
"""Names the agent gives itself in Home Assistant, in HA's language (its
configuration's `language`, chosen in the Hub's setup; on any other HA the
owner's). Areas in every language we know of; entity names where cheap (at
least German). Anything missing: English. The Hub's ha-setup creates the
areas with the same names (hub/.../cantabile/ha-setup: AREAS)."""
AREAS = {
"cantabile": {"en": "Cantabile"},
"flats": {"en": "Flats", "de": "Wohnungen", "ro": "Apartamente", "ru": "Квартиры", "fr": "Appartements",
"it": "Appartamenti", "es": "Pisos", "nl": "Appartementen"},
}
NAMES = {
"cloud": {"de": "Cloud"},
"mode": {"de": "Modus"},
"next_action": {"en": "Next action", "de": "Nächste Aktion"},
"plan": {"en": "{0}: plan", "de": "{0}: Plan"},
"price_import_now": {"en": "Electricity price now", "de": "Strompreis jetzt"},
"price_import_next": {"en": "Electricity price next", "de": "Strompreis als Nächstes"},
"price_export_now": {"en": "Feed-in price now", "de": "Einspeisevergütung jetzt"},
"price_other": {"en": "{0} price", "de": "Preis {0}"},
"model": {"en": "Forecast model", "de": "Prognosemodell"},
"commands": {"en": "Commands received", "de": "Empfangene Befehle"},
"commanded": {"en": "{0}: setting", "de": "{0}: Vorgabe"},
"received": {"en": "Commands received", "de": "Empfangene Befehle"},
# a command in words ({0} the control's name, {1} its value, {2} a mode)
"cmd_mode": {"en": "Mode: {2}", "de": "Modus: {2}"},
"cmd_control": {"en": "{0}: set to {1}", "de": "{0}: auf {1}"},
"cmd_release": {"en": "{0}: back to the plan", "de": "{0}: zurück zum Plan"},
"cmd_limits": {"en": "{0}: new limits", "de": "{0}: neue Grenzen"},
"cmd_tariff": {"en": "New tariff", "de": "Neuer Tarif"},
"cmd_model": {"en": "New forecast model", "de": "Neues Prognosemodell"},
"cmd_building": {"en": "Message from the building", "de": "Nachricht vom Gebäude"},
"flat_grid": {"en": "Grid power", "de": "Netzbezug"},
"flat_flex": {"en": "Flexibility", "de": "Flexibilität"},
"flat_request": {"en": "Building's request", "de": "Anfrage des Gebäudes"},
"flat_state": {"en": "State", "de": "Zustand"},
# dashboards (dashboards.py)
"dash_main": {"en": "Cantabile"},
"dash_climate": {"en": "Heating & cooling", "de": "Heizung & Kühlung"},
"card_plan": {"en": "Plan, next 48 h", "de": "Plan, nächste 48 h"},
"card_prices": {"en": "Prices, next 48 h (ct/kWh)", "de": "Preise, nächste 48 h (ct/kWh)"},
"card_devices": {"en": "What Cantabile sets", "de": "Was Cantabile vorgibt"},
"card_power": {"en": "Power", "de": "Leistung"},
"card_price": {"en": "Electricity price", "de": "Strompreis"},
"card_daily": {"en": "Energy per day", "de": "Energie pro Tag"},
"card_monthly": {"en": "Energy per month", "de": "Energie pro Monat"},
"card_rooms": {"en": "Rooms", "de": "Räume"},
"assumed_hint": {"en": "This thermostat does not report back (infrared): what it shows is what was last sent to "
"it, not measured.",
"de": "Dieses Thermostat meldet nichts zurück (Infrarot): Angezeigt wird, was zuletzt gesendet "
"wurde, nicht gemessen."},
"source": {"en": "{0}: from", "de": "{0}: von"},
# the dashboard's views (dashboards.py)
"view_energy": {"en": "Energy", "de": "Energie"},
"view_building": {"en": "Building", "de": "Gebäude"},
"devices_page": {"en": "Devices: use Home Assistant's devices with Cantabile",
"de": "Geräte: Geräte aus Home Assistant mit Cantabile nutzen"},
"card_cloud": {"en": "Cantabile Cloud", "de": "Cantabile Cloud"},
"mode_off": {"en": "Off", "de": "Aus"},
"mode_off_why": {"en": "Cantabile does not read your home.", "de": "Cantabile liest Ihr Zuhause nicht."},
"mode_shadow": {"en": "Watching", "de": "Beobachten"},
"mode_shadow_why": {"en": "Cantabile follows your home and changes nothing.",
"de": "Cantabile verfolgt Ihr Zuhause und verändert nichts."},
"mode_advisory": {"en": "Advising", "de": "Beraten"},
"mode_advisory_why": {"en": "Cantabile plans and suggests; you decide.",
"de": "Cantabile plant und schlägt vor; Sie entscheiden."},
"mode_auto": {"en": "Automatic", "de": "Automatisch"},
"mode_auto_why": {"en": "Cantabile runs the devices you allowed.",
"de": "Cantabile steuert die Geräte, die Sie freigegeben haben."},
"now": {"en": "Now", "de": "Jetzt"},
"today": {"en": "Today", "de": "Heute"},
"solar": {"en": "Solar", "de": "Solar"},
"home": {"en": "Home", "de": "Haus"},
"grid": {"en": "Grid", "de": "Netz"},
"feed_in": {"en": "Feed-in", "de": "Einspeisung"},
"battery": {"en": "Battery", "de": "Batterie"},
"battery_soc": {"en": "Battery charge", "de": "Batterieladung"},
"battery_in": {"en": "Battery charged", "de": "Batterie geladen"},
"battery_out": {"en": "Battery discharged", "de": "Batterie entladen"},
"from_grid": {"en": "From the grid", "de": "Aus dem Netz"},
"to_grid": {"en": "To the grid", "de": "Ins Netz"},
"heat_pump": {"en": "Heat pump", "de": "Wärmepumpe"},
"ev": {"en": "Car", "de": "Auto"},
"circuits": {"en": "Circuits", "de": "Stromkreise"},
"of": {"en": "of", "de": "von"},
"total": {"en": "Total", "de": "Gesamt"},
"values": {"en": "Values", "de": "Werte"},
"switched_on": {"en": "switched on", "de": "eingeschaltet"},
"member_of": {"en": "Member of **{0}**, unit {1}.", "de": "Mitglied von **{0}**, Einheit {1}."},
"community_of": {"en": "Member of the community **{0}**.", "de": "Mitglied der Gemeinschaft **{0}**."},
"request_to": {"en": "Asked to join **{0}**: waiting for the operator.",
"de": "Beitritt zu **{0}** angefragt: wartet auf den Betreiber."},
"devices": {"en": "Devices", "de": "Geräte"},
"fan": {"en": "fan", "de": "Lüfter"},
"price_now": {"en": "Electricity now", "de": "Strom jetzt"},
"feed_in_now": {"en": "feed-in", "de": "Einspeisung"},
"cheapest": {"en": "Next 24 h: cheapest", "de": "Nächste 24 h: am günstigsten"},
"dearest": {"en": "dearest", "de": "am teuersten"},
"kind_heating": {"en": "heating", "de": "Heizen"},
"kind_cooling": {"en": "cooling", "de": "Kühlen"},
"coming": {"en": "Coming up", "de": "Als Nächstes"},
"nothing_planned": {"en": "Nothing planned.", "de": "Nichts geplant."},
"sets_release": {"en": "not controlling: your own settings apply",
"de": "keine Vorgabe: Ihre eigenen Einstellungen gelten"},
"your_settings": {"en": "your own settings", "de": "Ihre eigenen Einstellungen"},
"sets_holds": {"en": "holds", "de": "hält"},
"from_plan": {"en": "Following the plan.", "de": "Nach Plan."},
"from_cloud": {"en": "Asked by Cantabile Cloud.", "de": "Von der Cantabile Cloud angefragt."},
"from_building": {"en": "Asked by the building.", "de": "Vom Gebäude angefragt."},
"from_owner": {"en": "You changed it by hand: Cantabile waits.",
"de": "Von Ihnen von Hand geändert: Cantabile wartet."},
"from_safe_default": {"en": "No current plan: your own settings until there is one.",
"de": "Kein aktueller Plan: bis dahin Ihre eigenen Einstellungen."},
"by_cloud": {"en": "Cantabile Cloud", "de": "Cantabile Cloud"},
"by_building": {"en": "Building", "de": "Gebäude"},
"by_grid": {"en": "Grid operator", "de": "Netzbetreiber"},
"by_console": {"en": "Console", "de": "Konsole"},
"what": {"en": "What", "de": "Was"},
"from": {"en": "From", "de": "Von"},
"time": {"en": "Time", "de": "Zeit"},
"control": {"en": "Control", "de": "Gerät"},
"value": {"en": "Value", "de": "Wert"},
"why": {"en": "Why", "de": "Warum"},
}
def lang(code: str | None) -> str:
"""HA's language ("de", "de-CH", "pt-BR") as our two-letter key."""
return (code or "en").split("-")[0].split("_")[0].lower() or "en"
def area(key: str, language: str | None) -> str:
t = AREAS[key]
return t.get(lang(language)) or t["en"]
def name(key: str, language: str | None, *args) -> str:
t = NAMES[key]
text = t.get(lang(language)) or t.get("en") or key.replace("_", " ").capitalize()
return text.format(*args)