Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions examples/server/v1/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,6 @@ async def status(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Boar
digital_interrupts={name: DigitalInterruptStatus(value=await di.value()) for (name, di) in self.digital_interrupts.items()},
)

async def model_attributes(self) -> Board.Attributes:
return Board.Attributes(remote=True)

async def set_power_mode(self, **kwargs):
raise NotImplementedError()

Expand Down
10 changes: 0 additions & 10 deletions src/viam/components/board/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,6 @@ async def status(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optio
"""
...

@abc.abstractmethod
async def model_attributes(self) -> Attributes:
"""
Get the attributes related to the model of this board.

Returns:
Attributes: The attributes.
"""
...

@abc.abstractmethod
async def set_power_mode(
self, mode: PowerMode.ValueType, duration: Optional[timedelta] = None, *, timeout: Optional[float] = None, **kwargs
Expand Down
3 changes: 0 additions & 3 deletions src/viam/components/board/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ async def status(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optio
response: StatusResponse = await self.client.Status(request, timeout=timeout)
return response.status

async def model_attributes(self) -> Board.Attributes:
return Board.Attributes(remote=True)

async def do_command(self, command: Mapping[str, ValueTypes], *, timeout: Optional[float] = None) -> Mapping[str, ValueTypes]:
request = DoCommandRequest(name=self.name, command=dict_to_struct(command))
response: DoCommandResponse = await self.client.DoCommand(request, timeout=timeout)
Expand Down
3 changes: 0 additions & 3 deletions tests/mocks/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,6 @@ async def status(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optio
digital_interrupts={name: DigitalInterruptStatus(value=await di.value()) for (name, di) in self.digital_interrupts.items()},
)

async def model_attributes(self) -> Board.Attributes:
return Board.Attributes(remote=True)

async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None) -> List[Geometry]:
self.extra = extra
self.timeout = timeout
Expand Down
15 changes: 1 addition & 14 deletions tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from grpclib import GRPCError
from grpclib.testing import ChannelFor

from viam.components.board import Board, BoardClient
from viam.components.board import BoardClient
from viam.components.board.service import BoardRPCService
from viam.components.generic.service import GenericRPCService
from viam.errors import ResourceNotFoundError
Expand Down Expand Up @@ -121,11 +121,6 @@ async def test_status(self, board: MockBoard):
assert board.extra == extra
assert board.timeout == loose_approx(1.82)

@pytest.mark.asyncio
async def test_model_attributes(self, board: MockBoard):
attrs = await board.model_attributes()
assert attrs == Board.Attributes(remote=True)

@pytest.mark.asyncio
async def test_do(self, board: MockBoard):
command = {"command": "args"}
Expand Down Expand Up @@ -415,14 +410,6 @@ async def test_status(self, board: MockBoard, service: BoardRPCService):
assert board.extra == extra
assert board.timeout == loose_approx(1.1)

@pytest.mark.asyncio
async def test_model_attributes(self, board: MockBoard, service: BoardRPCService):
async with ChannelFor([service]) as channel:
client = BoardClient(name=board.name, channel=channel)

attrs = await client.model_attributes()
assert attrs == Board.Attributes(remote=True)

@pytest.mark.asyncio
async def test_do(self, board: MockBoard, service: BoardRPCService):
async with ChannelFor([service]) as channel:
Expand Down