Enhance CoverDevice with automatic command type detection #654
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.
This pull request adds automatic detection of the command type used by
CoverDevice
("open"/"close" vs "on"/"off"), improving compatibility with different device models and reducing the need for manual configuration. It includes a manual override method, updates documentation and examples, and bumps the project version.CoverDevice command detection and configuration:
CoverDevice
to automatically determine whether to use "open"/"close" or "on"/"off" commands by checking device status on the first use, defaulting to "on"/"off" for backward compatibility (tinytuya/CoverDevice.py
).set_cover_command_type(use_open_close=True)
method to allow manual override of the detected command type (tinytuya/CoverDevice.py
).Documentation and examples:
README.md
to document the new command detection behavior and manual override method (tinytuya/CoverDevice.py
,README.md
). [1] [2]README.md
demonstrating how to useCoverDevice
with both automatic detection and manual override (README.md
).Closes #653