2021-10-06 21:43:18 +02:00
|
|
|
from enum import Enum
|
|
|
|
|
|
|
|
|
2021-10-07 01:37:48 +02:00
|
|
|
class Directions(Enum):
|
|
|
|
INSIDE = "indoor"
|
|
|
|
OUTSIDE = "outdoor"
|
|
|
|
|
2021-10-07 12:37:33 +02:00
|
|
|
def other(self, direction: 'Direction') -> 'Direction':
|
2021-10-07 01:37:48 +02:00
|
|
|
if direction is Directions.INSIDE:
|
|
|
|
return Directions.OUTSIDE
|
|
|
|
else:
|
|
|
|
return Directions.INSIDE
|
|
|
|
|
|
|
|
def __iter__(self):
|
|
|
|
return [self.INSIDE, self.OUTSIDE]
|
2021-10-06 21:43:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ToFSensor:
|
2021-10-07 01:37:48 +02:00
|
|
|
def open(self) -> None:
|
2021-10-06 21:43:18 +02:00
|
|
|
raise NotImplementedError()
|
|
|
|
|
2021-10-07 01:37:48 +02:00
|
|
|
def setDirection(self, direction: Directions) -> None:
|
2021-10-06 21:43:18 +02:00
|
|
|
"""Configure sensor to pick up the distance in a specific direction.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
def getDistance(self) -> float:
|
|
|
|
"""Returns new distance in cm.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError()
|
2021-10-07 01:37:48 +02:00
|
|
|
|
|
|
|
def close(self) -> None:
|
2021-10-06 21:43:18 +02:00
|
|
|
raise NotImplementedError()
|