Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ 初心者向け
#160 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

models/telemetry.py の TelemetryColorLogicLight から開始し、Telemetry.load_xml を Telemetry.model_validate() まで追ってください。@specialEffect を欠く、示されている ColorLogic-Light 要素でパースを再現してください。完了条件は、その属性なしでテレメトリの検証に成功し、デフォルトの効果なしの動作が維持されることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
10
フォーク
13
平均マージ
5分
マージ済み PR(30日)
2

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cryptk/python-omnilogic-local のほかの issue

cryptk/python-omnilogic-local の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。