From 4616cfd044f897ec24c44bc1c5db2b25cfea7514 Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Wed, 9 Sep 2026 15:36:03 +0200 Subject: [PATCH] Shelly Verbraucher: dopppelte Einstellung entfernt --- packages/modules/consumers/shelly/shelly_em/config.py | 2 -- packages/modules/consumers/shelly/shelly_em/consumer.py | 3 ++- packages/modules/consumers/shelly/shelly_pm/config.py | 2 -- packages/modules/consumers/shelly/shelly_pm/consumer.py | 3 ++- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/modules/consumers/shelly/shelly_em/config.py b/packages/modules/consumers/shelly/shelly_em/config.py index 78352042e4..97ce33b15b 100644 --- a/packages/modules/consumers/shelly/shelly_em/config.py +++ b/packages/modules/consumers/shelly/shelly_em/config.py @@ -11,12 +11,10 @@ class ShellyConfiguration: def __init__(self, ip_address: Optional[str] = None, factor: int = -1, - phase: int = 1, username: Optional[str] = None, password: Optional[str] = None) -> None: self.ip_address = ip_address self.factor = factor - self.phase = phase self.username = username self.password = password diff --git a/packages/modules/consumers/shelly/shelly_em/consumer.py b/packages/modules/consumers/shelly/shelly_em/consumer.py index 29f411cc2d..edceb74e85 100644 --- a/packages/modules/consumers/shelly/shelly_em/consumer.py +++ b/packages/modules/consumers/shelly/shelly_em/consumer.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from control import data from modules.common.abstract_device import DeviceDescriptor from typing import Optional from modules.common.component_state import ConsumerState @@ -24,7 +25,7 @@ def error_handler() -> None: def update() -> ConsumerState: status = request_status(config.configuration.ip_address, generation) powers, voltages, currents, _, power, _ = parse_data( - config.configuration.phase, config.configuration.factor, status) + data.data.consumer_data[f"consumer{config.id}"].data.config.phase_1, config.configuration.factor, status) imported, exported = sim_counter.sim_count(power) consumer_state = ConsumerState( power=power, diff --git a/packages/modules/consumers/shelly/shelly_pm/config.py b/packages/modules/consumers/shelly/shelly_pm/config.py index 09dfb24790..51b5080a45 100644 --- a/packages/modules/consumers/shelly/shelly_pm/config.py +++ b/packages/modules/consumers/shelly/shelly_pm/config.py @@ -11,13 +11,11 @@ class ShellyConfiguration: def __init__(self, ip_address: Optional[str] = None, factor: int = -1, - phase: int = 1, channel: int = 0, username: Optional[str] = None, password: Optional[str] = None) -> None: self.ip_address = ip_address self.factor = factor - self.phase = phase self.channel = channel self.username = username self.password = password diff --git a/packages/modules/consumers/shelly/shelly_pm/consumer.py b/packages/modules/consumers/shelly/shelly_pm/consumer.py index cb5940323a..74e02cd600 100644 --- a/packages/modules/consumers/shelly/shelly_pm/consumer.py +++ b/packages/modules/consumers/shelly/shelly_pm/consumer.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +from control import data from modules.common import req from typing import Optional from modules.common.abstract_device import DeviceDescriptor @@ -62,7 +63,7 @@ def switch_off() -> None: def update() -> ConsumerState: status = request_status(config.configuration.ip_address, generation) powers, voltages, currents, _, power, _ = parse_data( - config.configuration.phase, config.configuration.factor, status) + data.data.consumer_data[f"consumer{config.id}"].data.config.phase_1, config.configuration.factor, status) imported, exported = sim_counter.sim_count(power) return ConsumerState( power=power,