Skip to content

Universelles Modbus-Modul: Faktor zur Registerauslesung - #3741

Merged
LKuemmel merged 4 commits into
openWB:masterfrom
AlexanderHa98:feature_universell_modbus_faktor
Aug 4, 2026
Merged

LKuemmel merged 4 commits into
openWB:masterfrom
AlexanderHa98:feature_universell_modbus_faktor

Conversation

@AlexanderHa98

@AlexanderHa98 AlexanderHa98 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Erweitert das Universell-Modbus-Modul um einen konfigurierbaren Faktor pro Register, um gelesene Werte (z. B. Vorzeichen/Skalierung) direkt bei der Registerauslesung anzupassen.

Changes:

  • RegisterConfig um reg_factor erweitert (Default-Faktor).
  • read_value() multipliziert gelesene Registerwerte mit dem konfigurierten Faktor.

Reviewed changes

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

File Description
packages/modules/devices/generic/modbus/helper.py Skaliert gelesene Registerwerte über reg_factor.
packages/modules/devices/generic/modbus/config.py Fügt reg_factor zur Register-Konfiguration hinzu.

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

Comment on lines +29 to +31
if value is not None:
value *= register_config.reg_factor
return value
@AlexanderHa98
AlexanderHa98 requested a review from LKuemmel July 31, 2026 09:59

@LKuemmel LKuemmel 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.

unit=unit,
)

factor = register_config.reg_factor if register_config.reg_factor is not None else 1

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.

Hast Du nicht in Zeile 9 bereits ausgeschlossen, dass reg_factor None ist?

@AlexanderHa98
AlexanderHa98 requested a review from LKuemmel August 4, 2026 08:20
@LKuemmel
LKuemmel marked this pull request as ready for review August 4, 2026 08:35
@LKuemmel LKuemmel changed the title Add Faktor-Input zur Registerauslesung Universelles Modbus-Modul: Faktor zur Registerauslesung Aug 4, 2026
@LKuemmel
LKuemmel merged commit 0a35d59 into openWB:master Aug 4, 2026
1 check passed
ndrsnhs pushed a commit to ndrsnhs/core that referenced this pull request Aug 24, 2026
* Add Faktor-Input zur Registerauslesung

* Add Copilot suggestions

* Update type von reg_factor

* fix
@AlexanderHa98
AlexanderHa98 deleted the feature_universell_modbus_faktor branch October 28, 2026 07:01
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.

Universell Modbus mit Faktor Berechnung

3 participants