blob: 602cab7828130eb42bfbb8b97a778053329af17a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from abc import ABC
from enum import Enum
class BaseSensor(ABC):
def __init__(self, bus: int):
super().__init__()
self.bus = smbus.SMBus(bus)
def humidity(self) -> float:
pass
def temperature(self) -> float:
pass
class SensorType(Enum):
Si7021 = 'si7021'
DHT12 = 'dht12'
|