fix: wrap filter() with list() in water_heater operation_list#5216
Merged
make-all merged 2 commits intoJun 2, 2026
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TuyaLocalWaterHeater.operation_listreturns afilterobject instead of alist. This is a regression from the 2026.5.4 to 2026.6.0 cycle.Because
operation_listis part of the water heater'scapability_attributes, the lazyfilteriterator breaks JSON serialisation in Home Assistant, producing errors like:Fix
Wrap the
filter()call withlist()at line 139 ofwater_heater.py.Testing
uv run ruff checkpasseslisttypeFixes #5215