From 0ce2aa5941fd83850cb1bfaf245880ee1173e8cf Mon Sep 17 00:00:00 2001 From: Dmitriy Bazanov Date: Thu, 26 Oct 2023 23:32:17 +0300 Subject: [PATCH] Upd --- src/equipment/turtle_device.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/equipment/turtle_device.py b/src/equipment/turtle_device.py index 6dc3001..787b3ad 100644 --- a/src/equipment/turtle_device.py +++ b/src/equipment/turtle_device.py @@ -54,7 +54,6 @@ class TurtleDevice(SynchronyDevice): raise NoSuchTrait def invalidate(self, trait_name: str) -> None: - # NOTE: если я правильно понял, что должен делать метод self.write(trait_name=trait_name, value=Turtle().__getattribute__(trait_name)) return @@ -88,10 +87,13 @@ class TurtleDevice(SynchronyDevice): result = [] for method_name in methods: method = getattr(self.turtle, method_name) - args = inspect.signature(method).parameters + parameters = inspect.signature(method).parameters + arg_types = {} - for arg_name, arg in args.items(): - arg_types[arg_name] = arg.annotation + for arg_name, arg in parameters.items(): + arg_types[arg_name] = parameters[arg_name].annotation + + result.append( ActionDescriptor( name=method_name, info=method.__doc__, arguments=arg_types