-
Notifications
You must be signed in to change notification settings - Fork 113
io action: error of io device use remaining energy, show message #3080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -137,35 +137,33 @@ def _limit_by_current(self, | |||||
| def _limit_by_dimming_via_direct_control(self, | ||||||
| missing_currents: List[float], | ||||||
| cp: Chargepoint) -> Tuple[List[float], LoadmanagementLimit]: | ||||||
| if data.data.io_actions.dimming_via_direct_control({"type": "cp", "id": cp.num}): | ||||||
| value, limit = data.data.io_actions.dimming_via_direct_control({"type": "cp", "id": cp.num}) | ||||||
| if value is not None: | ||||||
|
Comment on lines
+140
to
+141
|
||||||
| phases = 3-missing_currents.count(0) | ||||||
| current_per_phase = 4200 / 230 / phases | ||||||
| available_currents = [current_per_phase - | ||||||
| cp.data.set.target_current if c > 0 else 0 for c in missing_currents] | ||||||
| log.debug(f"Dimmung per Direkt-Steuerung: {available_currents}A") | ||||||
| limit = LoadmanagementLimit(LimitingValue.DIMMING_VIA_DIRECT_CONTROL.value, | ||||||
| LimitingValue.DIMMING_VIA_DIRECT_CONTROL) | ||||||
| return available_currents, limit | ||||||
| else: | ||||||
| return missing_currents, LoadmanagementLimit(None, None) | ||||||
| available_currents = missing_currents | ||||||
| return available_currents, limit | ||||||
|
|
||||||
| def _limit_by_dimming(self, | ||||||
| available_currents: List[float], | ||||||
| cp: Chargepoint) -> Tuple[List[float], LoadmanagementLimit]: | ||||||
| dimming_power_left = data.data.io_actions.dimming_get_import_power_left({"type": "cp", "id": cp.num}) | ||||||
| dimming_power_left, limit = data.data.io_actions.dimming_get_import_power_left({"type": "cp", "id": cp.num}) | ||||||
| if dimming_power_left: | ||||||
| if sum(available_currents)*230 > dimming_power_left: | ||||||
| phases = 3-available_currents.count(0) | ||||||
| overload_per_phase = (sum(available_currents) - dimming_power_left/230)/phases | ||||||
| available_currents = [c - overload_per_phase if c > 0 else 0 for c in available_currents] | ||||||
| log.debug(f"Reduzierung der Ströme durch die Dimmung: {available_currents}A") | ||||||
| return available_currents, LoadmanagementLimit(LimitingValue.DIMMING.value, LimitingValue.DIMMING) | ||||||
| return available_currents, LoadmanagementLimit(None, None) | ||||||
| return available_currents, limit | ||||||
|
|
||||||
| def _limit_by_ripple_control_receiver(self, | ||||||
| available_currents: List[float], | ||||||
| cp: Chargepoint) -> Tuple[List[float], LoadmanagementLimit]: | ||||||
| value = data.data.io_actions.ripple_control_receiver({"type": "cp", "id": cp.num}) | ||||||
| value, limit = data.data.io_actions.ripple_control_receiver({"type": "cp", "id": cp.num}) | ||||||
| if value != 1: | ||||||
| phases = 3-available_currents.count(0) | ||||||
| if phases > 1: | ||||||
|
|
@@ -177,9 +175,4 @@ def _limit_by_ripple_control_receiver(self, | |||||
| available_currents = [min(max_current*value - cp.data.set.target_current, c) | ||||||
|
||||||
| available_currents = [min(max_current*value - cp.data.set.target_current, c) | |
| available_currents = [max(min(max_current*value - cp.data.set.target_current, c), 0) |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||||||||||||||||||||||
| from control import data | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def check_fault_state_io_device(io_device: int) -> bool: | ||||||||||||||||||||||||||
| return data.data.io_states[f"io_states{io_device}"].data.get.fault_state == 2 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| def check_fault_state_io_device(io_device: int) -> bool: | |
| return data.data.io_states[f"io_states{io_device}"].data.get.fault_state == 2 | |
| from modules.common.fault_state_level import FaultStateLevel | |
| def check_fault_state_io_device(io_device: int) -> bool: | |
| return ( | |
| data.data.io_states[f"io_states{io_device}"].data.get.fault_state | |
| == FaultStateLevel.ERROR | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MISSING_CONFIFGURATIONenthält einen Tippfehler im Enum-Namen. Da der Wert neu eingeführt ist, wäre es sinnvoll, ihn jetzt konsistent alsMISSING_CONFIGURATIONzu benennen und die Verwendungen entsprechend anzupassen.