Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct type hint in replies.py #324

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lewis/utils/replies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
P = ParamSpec("P")


def _get_device_from(instance: StreamInterface):

Check failure on line 31 in lewis/utils/replies.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN202)

lewis/utils/replies.py:31:5: ANN202 Missing return type annotation for private function `_get_device_from`
try:
device = instance.device
except AttributeError:
Expand All @@ -41,7 +41,9 @@
return device


def conditional_reply(property_name: str, reply: str | None = None) -> Callable[P, T]:
def conditional_reply(
property_name: str, reply: str | None = None
) -> Callable[[Callable[P, T]], Callable[P, T]]:
"""
Decorator that executes the command and replies if the device has a member called
'property name' and it is True in a boolean context.
Expand Down
Loading