Repository navigation
diagram colors, pytests, remove extra meters from log data - #3742
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates consumer configuration and measurement logging so consumers can carry a diagram color, logging output can include consumer names/colors, and “extra meters” are excluded from counter log data.
Changes:
- Switch consumer module configs from mutable default
Listusage to immutableTupleusage and allow passing optional constructor kwargs through toConsumerSetup(e.g.,color). - Add
ConsumerSetup.colorwith a new default consumer color constant, and extend measurement logging to include consumer names/colors and skip “extra meter” counters. - Update logging and algorithm tests/fixtures to include consumer objects and hierarchy entries.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/modules/consumers/viessmann/viessmann_heat_pump/config.py | Use tuple usage default; forward kwargs to base setup (e.g., color). |
| packages/modules/consumers/stiebel/stiebel/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/solvis/solvis/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/shelly/shelly_pm/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/shelly/shelly_em/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/ratiotherm/ratiotherm/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/nibe/nibe_s_series/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/mystrom/mystrom/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/my_pv/elwa_e/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/my_pv/acthor/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/lambda_/lambda_/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/idm/idm/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/generic/mqtt/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/generic/json/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/generic/http/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/generic/dac/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/avm/avm/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/consumers/askoma/askoheat/config.py | Use tuple usage default; forward kwargs to base setup. |
| packages/modules/common/consumer_setup.py | Add optional color to consumer setup with default consumer color. |
| packages/helpermodules/constants.py | Add DEFAULT_COLORS.CONSUMER. |
| packages/helpermodules/measurement_logging/write_log.py | Skip extra-meter counters; include consumer names/colors in name/color extraction. |
| packages/helpermodules/measurement_logging/process_log.py | Aggregate colors for yearly log output (from monthly logs). |
| packages/helpermodules/measurement_logging/conftest.py | Extend logging test fixture with consumer module data. |
| packages/helpermodules/measurement_logging/write_log_test.py | Update expected names to include consumer. |
| packages/control/algorithm/integration_test/conftest.py | Extend integration fixture hierarchy/prios to include consumer load. |
| packages/control/algorithm/integration_test/pv_charging_test.py | Extend PV charging fixture for consumer current parameters; adds commented-out block. |
| packages/control/algorithm/integration_test/instant_charging_test.py | Extend instant charging fixture and expectations to include consumer current. |
| packages/control/algorithm/filter_chargepoints_test.py | Rename test function to match behavior under test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+146
to
+170
| # # alle 3 im PV-laden, keine Ladung -> bei zwei die Verzögerung starten, für den 3. reicht es nicht | ||
| # # setup | ||
| # data.data.counter_data["counter0"].data.set.raw_power_left = 32090 | ||
| # data.data.counter_data["counter0"].data.set.raw_currents_left = [32, 30, 31] | ||
| # data.data.counter_data["counter6"].data.set.raw_currents_left = [16, 12, 14] | ||
| # data.data.counter_data["counter0"].data.set.reserved_surplus = 0 | ||
|
|
||
| # # execution | ||
| # Algorithm().calc_current() | ||
|
|
||
| # # evaluation | ||
| # for i in range(3, 6): | ||
| # assert data.data.cp_data[f"cp{i}"].data.set.current == 0 | ||
| # assert data.data.consumer_data[f"consumer7"].data.set.current == 0 | ||
| # assert data.data.cp_data[ | ||
| # "cp3"].data.control_parameter.timestamp_switch_on_off is None | ||
| # assert data.data.cp_data[ | ||
| # "cp4"].data.control_parameter.timestamp_switch_on_off == 1652683252.0 | ||
| # assert data.data.cp_data[ | ||
| # "cp5"].data.control_parameter.timestamp_switch_on_off == 1652683252.0 | ||
| # assert data.data.consumer_data[ | ||
| # "consumer7"].data.control_parameter.timestamp_switch_on_off == 1652683252.0 | ||
| # assert data.data.counter_data["counter0"].data.set.raw_power_left == 32090 | ||
| # assert data.data.counter_data["counter0"].data.set.surplus_power_left == -690 | ||
| # assert data.data.counter_data["counter0"].data.set.reserved_surplus == 9115 |
Comment on lines
326
to
+327
| names.update(content["names"]) | ||
| colors.update(content["colors"]) |
LKuemmel
added a commit
that referenced
this pull request
Aug 6, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 18, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 18, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 19, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 19, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 20, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 20, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 20, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 21, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 24, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 26, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Aug 28, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Sep 7, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
to benderl/core
that referenced
this pull request
Sep 8, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Sep 9, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Sep 9, 2026
* fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8
LKuemmel
added a commit
that referenced
this pull request
Sep 9, 2026
* draft * draft * fixes * fixes * Anlauferkennung, Betriebsmodus zurücksetzen, Befehle für Pläne (#3588) * draft * Anlauferkennung * Betriebsmodus zurücksetzen * ammend * Anlauferkennung * draft * draft scheduled charging * add scheduled und time plan commands for adding and removing * flake8 * update config * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <[email protected]> * review * fix pytest --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]> * on time, fixes (#3612) * on_time * eco default price, typo * on_time accessible via 1883 (#3626) * on_time accessible via 1883 * fix * Add Consumer tab and cards to koala web theme (#3630) * add consumer tab/cards * apply new design to consumer cards * add consumer time on to consumer card * fix consumer card CSS * remove redundant placeholders * imported and exported for consumers; daily, monthly log; daily yields; graph data (#3644) * update module config * imported and exported for consumers * daily, monthly log * daily yields * graph data * Consumer cards in carousel - small screen mobile view (#3637) * Intergrate consumers in koala theme charts (#3672) * Add consumer to energy flow chart * Add consumer row to daily totals chart * Add consumer total to history chart * add consumer color to store * Align legend category dropdowns * Add consumer component to display flow chart (#3673) * Add consumer component to display flow chart * Add user management role * energy percentage, set usage per json, several fixes (#3705) * energy percentage, set usage per json * consider min interval * fixes * pv * fix * pycheck, fix extra meter * ammend * fixes * ammend * fix * switch interval elapsed * flake8 * improve wait for start * shelly, pytest (#3730) * add shelly, flake8, pytest consumer chargemodes * fix shelly * existing pytests running * review * fix colors, lookup dict names and colors for consumers (#3736) * fix colors, lookup dict names and colors for consumers * review * hide mode controls for consumer measurement only (#3715) * update consumer-configuration-access (user management) (#3743) * diagram colors, pytests, remove extra meters from log data (#3742) * fix colors, lookup dict names and colors for consumers * review * extend tests * add colors for yearly graph data * remove extra meters from log data * remove comment * flake8 * ammend * fix_merge * switch mode on card * update consumer button groups * update message - data order in consumer card * linting * reapply lost changes from #3715 * usage type self controlled (#3775) * usage type self controlled * fix * review * review (#3776) * calc on time (#3777) * calc on time * review * pytest (#3786) * fix pytest * fixes, pytest * review * fix * fixes (#3794) * typo * fix * pytest * Reworked IDM and Lambda consumer and add Ovum (#3737) * IDM: send PV/Hausverbrauch/Batterie via GLT statt Leistungsvorgabe * Lambda: PV-Überschuss statt power_limit an E-Manager senden * Add OVUM CubeSpeicher/MPlus consumer module * IDM: revert scaling factor, fix flake8 formatting * flake8 * Rename send_grid_values to send_values in config.py * Adjust surplus calculation to account for charging power Include charging power in surplus calculation to avoid misreporting surplus to the heat pump. * Update send_values function to send grid power * Add Self_Controlled for IDM and Lambda * flake8: fix syntax error and whitespace in consumer modules Stray pasted line broke lambda_ consumer.py syntax; idm/lambda_/ovum files had trailing whitespace on blank lines and missing EOF newlines. * split PR: remove moduls except mqtt * fix loadmanagement, clean up (#3819) * clean up * fix loadmanagement * review * review * flake8 * fix versions * fix merge error * consider non charging for consumers and update consumer state messages (#3840) * no charge for loads * consider non charging for consumers and update consumer state messages * flake8 * review * fix rebase * pass data object as parameter in set_power_limit methode (#3854) * fix some type hints (#3866) * fix reset of consumer state string (#3887) * pass data object as parameter in set_power_limit methode, review (#3856) * improve * review: update comments * flake8 * fix rebase * Verbraucher: Fixes für Löschen & Hinzufügen (#3909) * fixes delete consumer, add consumer * review * Verbraucher: Fixes für Topics und Anlauferkennung (#3911) * fixes * type hint * fix thread handling (#3912) --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: BrettS <[email protected]> Co-authored-by: Brett-S-OWB <[email protected]> Co-authored-by: Lutz Bender <[email protected]> Co-authored-by: SeaSpotter <[email protected]> Co-authored-by: benderl <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.