Skip to content

fix colors, lookup dict names and colors for consumers - #3736

Merged
LKuemmel merged 2 commits into
openWB:feature_consumerfrom
LKuemmel:consumer_dev
Jul 30, 2026
Merged

fix colors, lookup dict names and colors for consumers#3736
LKuemmel merged 2 commits into
openWB:feature_consumerfrom
LKuemmel:consumer_dev

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the “measurement logging” metadata lookup to include consumers (names + colors) and introduces a default consumer color so consumers can be consistently rendered in visualizations/log outputs.

Changes:

  • Adds color (with a default) to the ConsumerSetup base configuration and a new DEFAULT_COLORS.CONSUMER.
  • Updates multiple consumer module config constructors to forward additional keyword args to ConsumerSetup.
  • Extends write_log.get_names() / write_log.get_colors() to include the consumer group and updates the measurement logging test fixture accordingly.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/modules/consumers/viessmann/viessmann_heat_pump/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/stiebel/stiebel/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/solvis/solvis/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/shelly/shelly_pm/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/shelly/shelly_em/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/ratiotherm/ratiotherm/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/nibe/nibe_s_series/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/mystrom/mystrom/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/my_pv/elwa_e/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/my_pv/acthor/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/lambda_/lambda_/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/idm/idm/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/generic/mqtt/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/generic/json/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/generic/http/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/generic/dac/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/avm/avm/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/consumers/askoma/askoheat/config.py Allows forwarding extra config kwargs to the shared consumer setup (intended for color).
packages/modules/common/consumer_setup.py Adds a color field (defaulting to the new consumer default color).
packages/helpermodules/measurement_logging/write_log.py Adds consumer name/color resolution into log metadata.
packages/helpermodules/measurement_logging/write_log_test.py Updates name lookup test to expect consumer names.
packages/helpermodules/measurement_logging/conftest.py Seeds consumer test data so consumer name/color lookup works in tests.
packages/helpermodules/constants.py Adds DEFAULT_COLORS.CONSUMER.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +22 to +26
usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY,
ConsumerUsage.CONTINUOUS,
ConsumerUsage.SUSPENDABLE_ONOFF,
ConsumerUsage.SUSPENDABLE_TUNABLE]) -> None:
ConsumerUsage.SUSPENDABLE_TUNABLE],
**kwargs) -> None:
Comment on lines 14 to 18
# evaluation
assert names == {'bat2': "Speicher",
"consumer6": "MQTT-Verbraucher",
'counter0': "Zähler",
'cp3': "cp3",
Comment on lines +26 to +29
if color:
self.color = color
else:
self.color = DEFAULT_COLORS.CONSUMER.value
@LKuemmel
LKuemmel merged commit fffc1ce into openWB:feature_consumer Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants