poprawki i zmiany ux

This commit is contained in:
Mateusz Gruszczyński
2026-03-26 09:30:39 +01:00
parent fd0f645251
commit 138059945e
28 changed files with 1000 additions and 225 deletions

View File

@@ -59,7 +59,7 @@ APP_CONFIG = {
}
SITE_CONFIG = {
"site_name": os.getenv("SITE_NAME", "Domowa instalacja PV"),
"site_name": os.getenv("SITE_NAME", "Home PV installation"),
"timezone": APP_CONFIG["timezone"],
"installed_power_kwp": env_float("PV_INSTALLED_POWER_KWP", 9.99),
"currency": os.getenv("SITE_CURRENCY", "PLN"),
@@ -91,20 +91,20 @@ CORS_ORIGINS = [
]
TIME_RANGES = {
"today": {"label": "Dzis", "special": "today"},
"yesterday": {"label": "Wczoraj", "special": "yesterday"},
"today": {"label": "Today", "special": "today"},
"yesterday": {"label": "Yesterday", "special": "yesterday"},
"6h": {"label": "6h", "seconds": 6 * 3600},
"12h": {"label": "12h", "seconds": 12 * 3600},
"24h": {"label": "24h", "seconds": 24 * 3600},
"48h": {"label": "48h", "seconds": 48 * 3600},
"1d": {"label": "1 dzien", "seconds": 1 * 24 * 3600},
"3d": {"label": "3 dni", "seconds": 3 * 24 * 3600},
"7d": {"label": "7 dni", "seconds": 7 * 24 * 3600},
"14d": {"label": "14 dni", "seconds": 14 * 24 * 3600},
"30d": {"label": "30 dni", "seconds": 30 * 24 * 3600},
"60d": {"label": "60 dni", "seconds": 60 * 24 * 3600},
"90d": {"label": "90 dni", "seconds": 90 * 24 * 3600},
"365d": {"label": "365 dni", "seconds": 365 * 24 * 3600},
"1d": {"label": "1 day", "seconds": 1 * 24 * 3600},
"3d": {"label": "3 days", "seconds": 3 * 24 * 3600},
"7d": {"label": "7 days", "seconds": 7 * 24 * 3600},
"14d": {"label": "14 days", "seconds": 14 * 24 * 3600},
"30d": {"label": "30 days", "seconds": 30 * 24 * 3600},
"60d": {"label": "60 days", "seconds": 60 * 24 * 3600},
"90d": {"label": "90 days", "seconds": 90 * 24 * 3600},
"365d": {"label": "365 days", "seconds": 365 * 24 * 3600},
"ytd": {"label": "YTD", "special": "ytd"},
}
@@ -119,20 +119,20 @@ ANALYTICS = {
"default_range": os.getenv("ANALYTICS_DEFAULT_RANGE", "30d"),
"default_bucket": os.getenv("ANALYTICS_DEFAULT_BUCKET", "day"),
"bucket_labels": {
"day": "Dzien",
"week": "Tydzien",
"month": "Miesiac",
"year": "Rok",
"day": "Day",
"week": "Week",
"month": "Month",
"year": "Year",
},
"compare_modes": {
"none": "Porownanie",
"previous_period": "Poprzedni okres",
"previous_year": "Poprzedni rok",
"previous_year_2": "2 lata wstecz",
"previous_year_3": "3 lata wstecz",
"previous_month_12": "12 miesiecy wstecz",
"previous_month_24": "24 miesiace wstecz",
"custom_multi": "Wlasne zakresy",
"none": "Comparison",
"previous_period": "Previous period",
"previous_year": "Previous year",
"previous_year_2": "2 years back",
"previous_year_3": "3 years back",
"previous_month_12": "12 months back",
"previous_month_24": "24 months back",
"custom_multi": "Custom ranges",
},
}
@@ -208,7 +208,7 @@ register_metric(
entity_id=os.getenv("PV_AC_POWER_ENTITY", "sofarsolar_ac_power"),
measurement=os.getenv("PV_AC_POWER_MEASUREMENT", "W"),
unit="W",
label="Moc AC",
label="AC Power",
precision=0,
)
register_metric(
@@ -216,7 +216,7 @@ register_metric(
entity_id=os.getenv("PV_TOTAL_ENERGY_ENTITY", "sofarsolar_energy_total"),
measurement=os.getenv("PV_TOTAL_ENERGY_MEASUREMENT", "kWh"),
unit="kWh",
label="Energia laczna",
label="Total Energy",
kind="counter",
precision=2,
)
@@ -225,7 +225,7 @@ register_metric(
entity_id=os.getenv("PV_INVERTER_TEMP_ENTITY", "sofarsolar_temprature_inverter"),
measurement=os.getenv("PV_INVERTER_TEMP_MEASUREMENT", "°C"),
unit="°C",
label="Temperatura falownika",
label="Inverter Temperature",
precision=1,
)
@@ -243,7 +243,7 @@ for index, defaults in STRING_DEFAULTS.items():
entity_id=os.getenv(f"PV_STRING_{index}_POWER_ENTITY", defaults["power"]),
measurement=os.getenv(f"PV_STRING_{index}_POWER_MEASUREMENT", "W"),
unit="W",
label=f"{label} moc",
label=f"{label} power",
precision=0,
)
voltage_metric_id = register_metric(
@@ -251,7 +251,7 @@ for index, defaults in STRING_DEFAULTS.items():
entity_id=os.getenv(f"PV_STRING_{index}_VOLTAGE_ENTITY", defaults["voltage"]),
measurement=os.getenv(f"PV_STRING_{index}_VOLTAGE_MEASUREMENT", "V"),
unit="V",
label=f"{label} napiecie",
label=f"{label} voltage",
precision=1,
)