Add separate power/energy URLs and multipliers for REST smart plugs (#472)

REST/Webhook smart plugs can now fetch power and energy data from
  individual URLs instead of requiring all values in a single status
  response. Each value falls back to the shared Status URL when no
  separate URL is set, preserving backward compatibility. Added power
  and energy multipliers for unit conversion (e.g. 0.001 for Wh→kWh).
This commit is contained in:
maziggy
2026-04-03 08:31:08 +02:00
parent d327c70006
commit 76adf70fd4
18 changed files with 391 additions and 144 deletions
+12
View File
@@ -1111,8 +1111,12 @@ export interface SmartPlug {
rest_status_url: string | null;
rest_status_path: string | null;
rest_status_on_value: string | null;
rest_power_url: string | null;
rest_power_path: string | null;
rest_power_multiplier: number;
rest_energy_url: string | null;
rest_energy_path: string | null;
rest_energy_multiplier: number;
printer_id: number | null;
enabled: boolean;
auto_on: boolean;
@@ -1178,8 +1182,12 @@ export interface SmartPlugCreate {
rest_status_url?: string | null;
rest_status_path?: string | null;
rest_status_on_value?: string | null;
rest_power_url?: string | null;
rest_power_path?: string | null;
rest_power_multiplier?: number;
rest_energy_url?: string | null;
rest_energy_path?: string | null;
rest_energy_multiplier?: number;
printer_id?: number | null;
enabled?: boolean;
auto_on?: boolean;
@@ -1237,8 +1245,12 @@ export interface SmartPlugUpdate {
rest_status_url?: string | null;
rest_status_path?: string | null;
rest_status_on_value?: string | null;
rest_power_url?: string | null;
rest_power_path?: string | null;
rest_power_multiplier?: number;
rest_energy_url?: string | null;
rest_energy_path?: string | null;
rest_energy_multiplier?: number;
printer_id?: number | null;
enabled?: boolean;
auto_on?: boolean;