Skip to content

Commit

Permalink
refactor to_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalzauberzeug committed Sep 5, 2024
1 parent 916d5a2 commit b0e65c6
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 b0e65c6

Please sign in to comment.