|
1 | 1 | from dataclasses import dataclass |
2 | 2 | from threading import Lock |
3 | | -from typing import TYPE_CHECKING, Any, Callable, ClassVar, Coroutine, Dict, Generic, Mapping, Type, TypeVar |
| 3 | +from typing import TYPE_CHECKING, Callable, ClassVar, Dict, Generic, Mapping, Type, TypeVar |
4 | 4 |
|
5 | | -from google.protobuf.struct_pb2 import Struct |
6 | 5 | from grpclib.client import Channel |
7 | 6 |
|
8 | 7 | from viam.errors import DuplicateResourceError, ResourceNotFoundError, ValidationError |
9 | | -from viam.proto.robot import Status |
10 | 8 |
|
11 | 9 | from .base import ResourceBase |
12 | 10 |
|
|
16 | 14 |
|
17 | 15 | Resource = TypeVar("Resource", bound=ResourceBase) |
18 | 16 |
|
19 | | - |
20 | | -async def default_create_status(resource: ResourceBase) -> Status: |
21 | | - return Status(name=resource.get_resource_name(resource.name), status=Struct()) |
22 | | - |
23 | | - |
24 | 17 | @dataclass |
25 | 18 | class ResourceCreatorRegistration: |
26 | 19 | """An object representing a resource creator to be registered. |
@@ -63,12 +56,6 @@ class ResourceRegistration(Generic[Resource]): |
63 | 56 | """A function that will create the RPC client for this resource |
64 | 57 | """ |
65 | 58 |
|
66 | | - create_status: Callable[[Resource], Coroutine[Any, Any, Status]] = default_create_status |
67 | | - """A function to create a Status object for this resource. |
68 | | -
|
69 | | - If the resource does not provide a custom status type, the default implementation can be used. |
70 | | - """ |
71 | | - |
72 | 59 |
|
73 | 60 | class Registry: |
74 | 61 | """The global registry of robotic parts. |
|
0 commit comments