Skip to content

fix: wrap filter() with list() in water_heater operation_list#5216

Merged
make-all merged 2 commits into
make-all:mainfrom
toller892:fix-water-heater-operation-list
Jun 2, 2026
Merged

fix: wrap filter() with list() in water_heater operation_list#5216
make-all merged 2 commits into
make-all:mainfrom
toller892:fix-water-heater-operation-list

Conversation

@toller892

Copy link
Copy Markdown
Contributor

Description

TuyaLocalWaterHeater.operation_list returns a filter object instead of a list. This is a regression from the 2026.5.4 to 2026.6.0 cycle.

Because operation_list is part of the water heater's capability_attributes, the lazy filter iterator breaks JSON serialisation in Home Assistant, producing errors like:

Type is not JSON serializable: filter

Fix

Wrap the filter() call with list() at line 139 of water_heater.py.

Testing

  • uv run ruff check passes
  • Confirmed the returned value is now a list type

Fixes #5215

filter() returns a lazy iterator object, which is not JSON-serializable.
This causes Home Assistant to fail when serializing capability_attributes
for water heater entities with operation modes.

Regression introduced in 2026.6.0.

Fixes make-all#5215
@make-all
make-all merged commit 7b418f1 into make-all:main Jun 2, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Tuya Local Jun 2, 2026
make-all added a commit that referenced this pull request Jun 2, 2026
btoddb pushed a commit to btoddb/tuya-local that referenced this pull request Jun 5, 2026
…ll#5216)

* fix: wrap filter() with list() in water_heater operation_list

filter() returns a lazy iterator object, which is not JSON-serializable.
This causes Home Assistant to fail when serializing capability_attributes
for water heater entities with operation modes.

Regression introduced in 2026.6.0.

Fixes make-all#5215

* Reformatting to satisfy lint

---------

Co-authored-by: toller892 <toller892@gmail.com>
Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
btoddb pushed a commit to btoddb/tuya-local that referenced this pull request Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

water_heater: operation_list returns a filter object instead of a list (2026.6.0 regression)

2 participants