Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/modules/consumers/shelly/shelly_em/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Comment on lines 11 to 15
self.ip_address = ip_address
self.factor = factor
self.phase = phase
self.username = username
self.password = password

Expand Down
3 changes: 2 additions & 1 deletion packages/modules/consumers/shelly/shelly_em/consumer.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions packages/modules/consumers/shelly/shelly_pm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines 11 to 15
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
Expand Down
3 changes: 2 additions & 1 deletion packages/modules/consumers/shelly/shelly_pm/consumer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
Expand Down