From 78f0b84b4c70bde554f6f0830fc55756aaf9522a Mon Sep 17 00:00:00 2001 From: purplenicole730 Date: Tue, 14 Jan 2025 16:43:43 -0500 Subject: [PATCH] hit missed files --- docs/examples/module_step2.py | 2 +- docs/examples/module_step3.py | 4 ++-- src/viam/components/arm/arm.py | 2 +- src/viam/components/gantry/gantry.py | 2 +- src/viam/components/generic/generic.py | 2 +- src/viam/components/gripper/gripper.py | 2 +- src/viam/services/vision/vision.py | 2 +- tests/mocks/module/gizmo/api.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/examples/module_step2.py b/docs/examples/module_step2.py index bd13327bd..2e6ed7f35 100644 --- a/docs/examples/module_step2.py +++ b/docs/examples/module_step2.py @@ -35,7 +35,7 @@ async def close(self): async def main(): - Registry.register_resource_creator(Sensor.SUBTYPE, MySensor.MODEL, ResourceCreatorRegistration(MySensor.new)) + Registry.register_resource_creator(Sensor.API, MySensor.MODEL, ResourceCreatorRegistration(MySensor.new)) if __name__ == "__main__": diff --git a/docs/examples/module_step3.py b/docs/examples/module_step3.py index d648c51f4..75cdff2a2 100644 --- a/docs/examples/module_step3.py +++ b/docs/examples/module_step3.py @@ -40,10 +40,10 @@ async def main(): This function creates and starts a new module, after adding all desired resource model. Resource creators must be registered to the resource registry before the module adds the resource model. """ - Registry.register_resource_creator(Sensor.SUBTYPE, MySensor.MODEL, ResourceCreatorRegistration(MySensor.new)) + Registry.register_resource_creator(Sensor.API, MySensor.MODEL, ResourceCreatorRegistration(MySensor.new)) module = Module.from_args() - module.add_model_from_registry(Sensor.SUBTYPE, MySensor.MODEL) + module.add_model_from_registry(Sensor.API, MySensor.MODEL) await module.start() diff --git a/src/viam/components/arm/arm.py b/src/viam/components/arm/arm.py index c8137b163..bb8e883a6 100644 --- a/src/viam/components/arm/arm.py +++ b/src/viam/components/arm/arm.py @@ -26,7 +26,7 @@ class Arm(ComponentBase): For more information, see `Arm component `_. """ - SUBTYPE: Final = API(RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "arm") # pyright: ignore [reportIncompatibleVariableOverride] + API: Final = API(RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "arm") # pyright: ignore [reportIncompatibleVariableOverride] @abc.abstractmethod async def get_end_position( diff --git a/src/viam/components/gantry/gantry.py b/src/viam/components/gantry/gantry.py index 98e652835..58d978c8c 100644 --- a/src/viam/components/gantry/gantry.py +++ b/src/viam/components/gantry/gantry.py @@ -21,7 +21,7 @@ class Gantry(ComponentBase): For more information, see `Gantry component `_. """ - SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] + API: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "gantry" ) diff --git a/src/viam/components/generic/generic.py b/src/viam/components/generic/generic.py index 1c58c46e9..511bdb5e0 100644 --- a/src/viam/components/generic/generic.py +++ b/src/viam/components/generic/generic.py @@ -71,6 +71,6 @@ def complex_command(self, arg1, arg2, arg3): For more information, see `Gantry component `_. """ - SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] + API: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "generic" ) diff --git a/src/viam/components/gripper/gripper.py b/src/viam/components/gripper/gripper.py index c64ca6097..992f6bbc8 100644 --- a/src/viam/components/gripper/gripper.py +++ b/src/viam/components/gripper/gripper.py @@ -20,7 +20,7 @@ class Gripper(ComponentBase): For more information, see `Gripper component `_. """ - SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] + API: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "gripper" ) diff --git a/src/viam/services/vision/vision.py b/src/viam/services/vision/vision.py index c1a235a46..61f126c59 100644 --- a/src/viam/services/vision/vision.py +++ b/src/viam/services/vision/vision.py @@ -63,7 +63,7 @@ class Vision(ServiceBase): For more information, see `Computer Vision service `_. """ - SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] + API: Final = API( # pyright: ignore [reportIncompatibleVariableOverride] RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE, "vision" ) diff --git a/tests/mocks/module/gizmo/api.py b/tests/mocks/module/gizmo/api.py index cfb56097c..8331da1aa 100644 --- a/tests/mocks/module/gizmo/api.py +++ b/tests/mocks/module/gizmo/api.py @@ -28,7 +28,7 @@ class Gizmo(ComponentBase): """Example component to use with the example module.""" - SUBTYPE: Final = Subtype("acme", RESOURCE_TYPE_COMPONENT, "gizmo") + API: Final = Subtype("acme", RESOURCE_TYPE_COMPONENT, "gizmo") @abc.abstractmethod async def do_one(self, arg1: str, **kwargs) -> bool: ...