Raise NotImplementedError in the fan preset guard instead of returning it - #989
Closed
dlxmax wants to merge 1 commit into
Closed
Raise NotImplementedError in the fan preset guard instead of returning it#989dlxmax wants to merge 1 commit into
dlxmax wants to merge 1 commit into
Conversation
…g it LGEFanWrapper.async_set_preset built the exception and returned it, so a missing set_fanpreset_fn silently did nothing rather than signalling that the control is unsupported. The two sibling guards in this file raise. No behaviour change today: no wrapper description defines fanpresets_fn without set_fanpreset_fn, so preset_modes is None whenever the setter is missing and LGEFan.async_set_preset_mode already raises before the wrapper is reached. This keeps the branch correct if that ever stops holding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C3rSu8SZWhxN5VkDc415jp
Author
|
Closing to reopen with a clean single-commit history. |
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.
LGEFanWrapper.async_set_presetbuilds the exception and returns it:so a missing
set_fanpreset_fnsilently does nothing instead of signalling that the control is unsupported. The caller discards the return value. The two sibling guards in this same file (async_set_percentage,async_set_preset_mode) bothraise.No behaviour change today. None of the four wrapper descriptions defines
fanpresets_fnwithout also definingset_fanpreset_fn, so_attr_preset_modesis only set when the setter exists.preset_modesis thereforeNonewhenever the setter is missing, andLGEFan.async_set_preset_modealready raises before the wrapper is reached. This just keeps the guard correct if that ever stops holding.Split out of #988 as an unrelated one-line fix.