This commit is contained in:
Mateusz Gruszczyński
2026-09-17 08:52:02 +02:00
parent ff4f2b60e7
commit b7846c3b9f
87 changed files with 3783 additions and 1418 deletions
+25 -19
View File
@@ -4,16 +4,16 @@ use crate::{
home_assistant, influxdb,
models::{
ApiTokenInfo, ApplicationSettings, Automation, ClimateGroup, ConfigurationExport,
ConnectionStatus, ConnectionType, DebugSettings, Device, DeviceCommand, DeviceGroup, DeviceGroupKind, DevicePatch, DiscoveryRequest,
EnergyReading, EnergySourcePreference, Flow, GreeSettings,
GreeCloudSettings, GreeCloudSettingsUpdate, GreeCloudSettingsView,
ConnectionStatus, ConnectionType, DebugSettings, Device, DeviceCommand, DeviceGroup,
DeviceGroupKind, DevicePatch, DiscoveryRequest, EnergyReading, EnergySourcePreference,
Flow, GreeCloudSettings, GreeCloudSettingsUpdate, GreeCloudSettingsView, GreeSettings,
GroupControlPatch, HaReading, HistorySettings, HomeAssistantSettings,
HomeAssistantSettingsUpdate, HomeAssistantSettingsView, InfluxDbSettings,
InfluxDbSettingsUpdate, InfluxDbSettingsView, ManualDeviceRequest, NightModeSettings,
NotificationSettings, NotificationSettingsUpdate, NotificationSettingsView, NetworkReading, Reading,
RuntimeSettings, Schedule, SettingsSnapshot, TemporaryQuickThermostat,
TemporaryQuickThermostatRequest, Zone,
ZoneControlPatch, ZoneReading,
InfluxDbSettingsUpdate, InfluxDbSettingsView, ManualDeviceRequest, NetworkReading,
NightModeSettings, NotificationSettings, NotificationSettingsUpdate,
NotificationSettingsView, Reading, RuntimeSettings, Schedule, SettingsSnapshot,
TemporaryQuickThermostat, TemporaryQuickThermostatRequest, Zone, ZoneControlPatch,
ZoneReading,
},
notifications,
protocol::merge_discovered,
@@ -50,14 +50,14 @@ mod openapi;
const INDEX_HTML: &str = include_str!("../web/index.html");
const CUSTOM_CHART_HTML: &str = include_str!("../web/custom-chart.html");
const CUSTOM_CHART_JS: &str = include_str!("../web/custom-chart.js");
const CUSTOM_CHART_JS: &str = include_str!("../web/js/custom-chart.js");
const NOT_FOUND_HTML: &str = include_str!("../web/404.html");
const APP_JS: &str = include_str!(concat!(env!("OUT_DIR"), "/app.bundle.js"));
const THEME_INIT_JS: &str = include_str!("../web/theme-init.js");
const LANG_INIT_JS: &str = include_str!("../web/lang-init.js");
const STYLES_CSS: &str = include_str!("../web/styles.css");
const THEME_INIT_JS: &str = include_str!("../web/js/theme-init.js");
const LANG_INIT_JS: &str = include_str!("../web/js/lang-init.js");
const STYLES_CSS: &str = include_str!("../web/css/styles.css");
const MANIFEST: &str = include_str!("../web/manifest.webmanifest");
const SERVICE_WORKER: &str = include_str!("../web/sw.js");
const SERVICE_WORKER: &str = include_str!("../web/js/sw.js");
const FAVICON: &str = include_str!("../web/favicon.svg");
include!(concat!(env!("OUT_DIR"), "/languages.rs"));
@@ -98,10 +98,15 @@ pub fn router(state: AppState) -> Router {
.route("/api/devices/:id/poll", post(poll_device))
.route("/api/devices/:id/probe", post(probe_device))
.route("/api/devices/:id/command", post(command_device))
.route("/api/device-groups", get(list_device_groups).post(create_device_group))
.route(
"/api/device-groups",
get(list_device_groups).post(create_device_group),
)
.route(
"/api/device-groups/:id",
get(get_device_group).put(update_device_group).delete(delete_device_group),
get(get_device_group)
.put(update_device_group)
.delete(delete_device_group),
)
.route("/api/zones", get(list_zones).post(create_zone))
.route(
@@ -183,6 +188,10 @@ pub fn router(state: AppState) -> Router {
"/api/settings/influxdb",
get(get_influxdb_settings).put(update_influxdb_settings),
)
.route(
"/api/integrations/influxdb/test",
post(test_influxdb_connection),
)
.route(
"/api/settings/notifications",
get(get_notification_settings).put(update_notification_settings),
@@ -209,10 +218,7 @@ pub fn router(state: AppState) -> Router {
"/api/access-tokens/:id",
axum::routing::delete(delete_access_token),
)
.route(
"/api/integrations/gree-cloud/test",
post(test_gree_cloud),
)
.route("/api/integrations/gree-cloud/test", post(test_gree_cloud))
.route(
"/api/integrations/gree-cloud/devices",
get(discover_gree_cloud_devices),