Skip to content

Conversation

@Pendragon77
Copy link
Contributor

Basierend auf folgendem Problemreport:

Forum

Bei Shelly 3EM-63 Gen3 ist len(meters) nicht die Anzahl der Phasen sondern die Gesamtlänge der Mesergebnisse und somit viel zu groß
Begrenzung auf 3 Phasen
Autobuild hat die verwaiste Variable gefunden.
@LKuemmel LKuemmel requested a review from ndrsnhs February 10, 2026 07:03
# shelly Pro3EM
elif "em:0" in status:
meters = status['em:0']
for i in range(len(meters)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Wäre es nicht einfacher:

for i in range(0, 3):
    if (f'{alphabetical_index[i]}_current' not in meters or
            meters.get(f'{alphabetical_index[i]}_current') is None):
        continue

Man geht alle 3 Möglichkeiten durch. Falls der Wert nicht existiert wird er übersprungen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Habe ich so angepasst

Anpassung an den Vorschlag von ndrsnhs. Ist einfacher...
Copy link
Contributor Author

@Pendragon77 Pendragon77 left a comment

Choose a reason for hiding this comment

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

Hast recht. Das sollte einfacher sein

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