Skip to content

Commit

Permalink
Frame interval fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matanster authored Feb 16, 2024
1 parent ee5332d commit 9c0beeb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pyrav4l2/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@ def __init__(self, numerator: int = 0, denominator: int = 0) -> None:
self.numerator = numerator
self.denominator = denominator

def __eq__(self, other: FrameInterval) -> bool:
return self.numerator == other.numerator and self.denominator == other.denominator

def __str__(self) -> str:
if self.numerator != 0:
return str(self.denominator / self.numerator)
if self.denominator != 0:
return str(self.numerator / self.denominator)
else:
return "0.0"

def __eq__(self, other: FrameInterval) -> bool:
return self.numerator == other.numerator and self.denominator == other.denominator
def __float__(self) -> float:
if self.denominator != 0:
return self.numerator / self.denominator
else:
return 0.0


class Device:
Expand Down

0 comments on commit 9c0beeb

Please sign in to comment.