This commit is contained in:
Dmitriy Bazanov 2023-10-26 23:32:17 +03:00
parent e9a0b2832e
commit 0ce2aa5941

View File

@ -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