Skip to content

Commit

Permalink
refactor to_dict (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalzauberzeug authored Sep 9, 2024
1 parent 2f66d57 commit 24ce27e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions field_friend/vision/calibratable_usb_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ def from_dict(cls, data: dict[str, Any]) -> Self:
}))

def to_dict(self) -> dict:
base_dict = {
'id': self.id,
'name': self.name,
'connect_after_init': self.connect_after_init,
'streaming': self.streaming,
'focal_length': self.focal_length,
'calibration': persistence.to_dict(self.calibration),
}
return base_dict | {name: param.value for name, param in self._parameters.items()}
return super().to_dict() | {'focal_length': self.focal_length} | {name: param.value for name, param in self._parameters.items()}

0 comments on commit 24ce27e

Please sign in to comment.