Skip to content

Commit

Permalink
feat: remove overwrite of from_dict
Browse files Browse the repository at this point in the history
and use `args_from_dict` in `RtspCamera`
  • Loading branch information
NiklasNeugebauer committed Feb 5, 2025
1 parent a4b7690 commit 3519faf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
4 changes: 0 additions & 4 deletions rosys/vision/mjpeg_camera/mjpeg_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ def to_dict(self) -> dict:
'ip': self.ip,
}

@classmethod
def from_dict(cls, data: dict) -> Self:
return cls(**data)

@property
def is_connected(self) -> bool:
return (self.device is not None) and self.device.is_connected
Expand Down
2 changes: 1 addition & 1 deletion rosys/vision/rtsp_camera/rtsp_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def to_dict(self) -> dict[str, Any]:
def from_dict(cls, data: dict[str, Any]) -> Self:
if 'jovision_profile' in data:
data['substream'] = data['jovision_profile']
return cls(**data)
return cls(**cls.args_from_dict(data))

@property
def is_connected(self) -> bool:
Expand Down
4 changes: 0 additions & 4 deletions rosys/vision/usb_camera/usb_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ def to_dict(self) -> dict[str, Any]:
name: param.value for name, param in self._parameters.items()
}

@classmethod
def from_dict(cls, data: dict[str, Any]) -> Self:
return cls(**data)

@property
def is_connected(self) -> bool:
return self.device is not None
Expand Down

0 comments on commit 3519faf

Please sign in to comment.