Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Telemetry parse fails: TelemetryColorLogicLight.special_effect required but MSP R4.4 omits @specialEffect

Geschlossen Anfängerfreundlich
#160 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
88/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Beginne in models/telemetry.py bei TelemetryColorLogicLight und verfolge Telemetry.load_xml durch Telemetry.model_validate(). Reproduziere das Parsen mit dem gezeigten ColorLogic-Light-Element ohne @specialEffect; fertig ist es, wenn die Telemetrie ohne dieses Attribut erfolgreich validiert wird und dabei das standardmäßige Verhalten ohne Effekt erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

Telemetry.load_xml() raises OmniParsingError for a controller whose <ColorLogic-Light> telemetry element does not include a specialEffect attribute. TelemetryColorLogicLight.special_effect is declared as a required field with no default, so Telemetry.model_validate() fails with a pydantic missing error and the whole telemetry fetch dies. For the haomnilogic-local HA integration this makes setup impossible — the config flow is permanently stuck on cannot_connect.

Environment

  • python-omnilogic-local 5.0.2 (also present on main — models/telemetry.py line ~269)
  • Hayward OmniLogic, MSP firmware R4.4
  • Equipment: 1 variable-speed filter pump, 1 ColorLogic light, 1 valve-actuator water feature, 1 HydraPure, unconfigured CSAD slot, virtual heater (no physical heater)
  • Consumed via cryptk/haomnilogic-local 2.0.2 on Home Assistant

Actual telemetry element from this controller

<ColorLogic-Light systemId="4" lightState="0" currentShow="11" speed="4" brightness="4" />

No specialEffect attribute. (Backyard, BodyOfWater, Filter, VirtualHeater, Relay, CSAD, Group all parse fine — this is the only failure, so CSAD empty ph/orp is not currently an issue for this system.)

Traceback

File ".../pyomnilogic_local/models/telemetry.py", line 559, in load_xml
    instance = Telemetry.model_validate(data["STATUS"])
pydantic_core._pydantic_core.ValidationError: 1 validation error for Telemetry
ColorLogic-Light.0.@specialEffect
  Field required [type=missing, input_value={'@systemId': 4, '@lightState': 0, '@currentShow': 11, '@speed': 4, '@brightness': 4}, input_type=dict]

The above exception was the direct cause of the following exception:
  ...
pyomnilogic_local.models.exceptions.OmniParsingError: Failed to parse Telemetry: 1 validation error for Telemetry
ColorLogic-Light.0.@specialEffect
  Field required [type=missing, ...]

Suggested fix

special_effect isn't required for correct operation (the HA light entity doesn't read it). Give it a default:

# pyomnilogic_local/models/telemetry.py  (class TelemetryColorLogicLight)
special_effect: ColorLogicSpecialEffect = Field(
    alias="@specialEffect", default=ColorLogicSpecialEffect.NO_EFFECT
)

Older / simple-mode ColorLogic configs and some MSP firmwares just don't send the attribute. A quick audit of the other Telemetry* models for required fields that older firmware may omit (e.g. @lastSpeed, CSAD @ph/@orp when empty-string) would likely prevent similar reports.

Workaround (in case it helps others)

Monkey-patched Telemetry.load_xml in the HA custom component's __init__.py to catch the specialEffect OmniParsingError, inject specialEffect="0" into <ColorLogic-Light .../>, and re-parse. Integration then sets up and all entities (light, valve, pump speed/presets, HydraPure, schedules, sensors) work.

Vorherrschende Sprache
Python
Sterne
10
Forks
13
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus cryptk/python-omnilogic-local

Alle Issues in cryptk/python-omnilogic-local

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.