Skip to content

Commit 27cdfd3

Browse files
rename subtype class
1 parent 203eba8 commit 27cdfd3

File tree

32 files changed

+75
-75
lines changed

32 files changed

+75
-75
lines changed

src/viam/components/arm/arm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import abc
22
from typing import Any, Dict, Final, Optional, Tuple
33

4-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
4+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
55

66
from ..component_base import ComponentBase
77
from . import JointPositions, KinematicsFileFormat, Pose
@@ -26,7 +26,7 @@ class Arm(ComponentBase):
2626
For more information, see `Arm component <https://docs.viam.com/dev/reference/apis/components/arm/>`_.
2727
"""
2828

29-
SUBTYPE: Final = Subtype(RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "arm") # pyright: ignore [reportIncompatibleVariableOverride]
29+
SUBTYPE: Final = API(RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "arm") # pyright: ignore [reportIncompatibleVariableOverride]
3030

3131
@abc.abstractmethod
3232
async def get_end_position(

src/viam/components/audio_input/audio_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from viam.media.audio import Audio, AudioStream
1010
from viam.proto.component.audioinput import PropertiesResponse
11-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
11+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
1212
from viam.streams import StreamSource
1313

1414
from ..component_base import ComponentBase
@@ -22,7 +22,7 @@ class AudioInput(ComponentBase, StreamSource[Audio]):
2222
overridden, it must call the ``super().__init__()`` function.
2323
"""
2424

25-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
25+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
2626
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "audio_input"
2727
)
2828

src/viam/components/base/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from dataclasses import dataclass
33
from typing import Any, Dict, Final, Optional
44

5-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
5+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
66

77
from ..component_base import ComponentBase
88
from . import Vector3
@@ -23,7 +23,7 @@ class Base(ComponentBase):
2323
For more information, see `Base component <https://docs.viam.com/dev/reference/apis/components/base/>`_.
2424
"""
2525

26-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
26+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
2727
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "base"
2828
)
2929

src/viam/components/board/board.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any, Dict, Final, List, Optional
55

66
from viam.proto.component.board import PowerMode, ReadAnalogReaderResponse, StreamTicksResponse
7-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
7+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
88
from viam.streams import Stream
99

1010
from ..component_base import ComponentBase
@@ -34,7 +34,7 @@ class Board(ComponentBase):
3434
For more information, see `Board component <https://docs.viam.com/dev/reference/apis/components/board/>`_.
3535
"""
3636

37-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
37+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
3838
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "board"
3939
)
4040

src/viam/components/camera/camera.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from viam.media.video import NamedImage, ViamImage
66
from viam.proto.common import ResponseMetadata
77
from viam.proto.component.camera import GetPropertiesResponse
8-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
8+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
99

1010
from ..component_base import ComponentBase
1111

@@ -30,7 +30,7 @@ class Camera(ComponentBase):
3030
For more information, see `Camera component <https://docs.viam.com/dev/reference/apis/components/camera/>`_.
3131
"""
3232

33-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
33+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
3434
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "camera"
3535
)
3636

src/viam/components/component_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from viam.resource.base import ResourceBase
1111

1212
if TYPE_CHECKING:
13-
from viam.resource.types import Subtype
13+
from viam.resource.types import API
1414
from viam.robot.client import RobotClient
1515

1616

@@ -23,7 +23,7 @@ class ComponentBase(abc.ABC, ResourceBase):
2323
All components must inherit from this class.
2424
"""
2525

26-
SUBTYPE: ClassVar["Subtype"]
26+
SUBTYPE: ClassVar["API"]
2727

2828
def __init__(self, name: str, *, logger: Optional[Logger] = None):
2929
self.name = name

src/viam/components/encoder/encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any, Dict, Final, Optional, Tuple
44

55
from viam.proto.component.encoder import PositionType
6-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
6+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
77

88
from ..component_base import ComponentBase
99

@@ -28,7 +28,7 @@ class Properties:
2828
For more information, see `Encoder component <https://docs.viam.com/dev/reference/apis/components/encoder/>`_.
2929
"""
3030

31-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
31+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
3232
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "encoder"
3333
)
3434

src/viam/components/gantry/gantry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import abc
22
from typing import Any, Dict, Final, List, Optional
33

4-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
4+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
55

66
from ..component_base import ComponentBase
77

@@ -21,7 +21,7 @@ class Gantry(ComponentBase):
2121
For more information, see `Gantry component <https://docs.viam.com/dev/reference/apis/components/gantry/>`_.
2222
"""
2323

24-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
24+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
2525
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "gantry"
2626
)
2727

src/viam/components/generic/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Final
22

3-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
3+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
44

55
from ..component_base import ComponentBase
66

@@ -71,6 +71,6 @@ def complex_command(self, arg1, arg2, arg3):
7171
For more information, see `Gantry component <https://docs.viam.com/dev/reference/apis/components/generic/>`_.
7272
"""
7373

74-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
74+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
7575
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "generic"
7676
)

src/viam/components/gripper/gripper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Any, Dict, Final, Optional
33

44
from viam.components.component_base import ComponentBase
5-
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
5+
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, API
66

77

88
class Gripper(ComponentBase):
@@ -20,7 +20,7 @@ class Gripper(ComponentBase):
2020
For more information, see `Gripper component <https://docs.viam.com/dev/reference/apis/components/gripper/>`_.
2121
"""
2222

23-
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
23+
SUBTYPE: Final = API( # pyright: ignore [reportIncompatibleVariableOverride]
2424
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "gripper"
2525
)
2626

0 commit comments

Comments
 (0)