54 строки
808 B
Python
54 строки
808 B
Python
|
from datetime import datetime
|
||
|
from pydantic import BaseModel
|
||
|
|
||
|
|
||
|
class Setting(BaseModel):
|
||
|
name: str
|
||
|
value: str
|
||
|
|
||
|
|
||
|
class HardwareType(BaseModel):
|
||
|
id: int
|
||
|
name: str
|
||
|
|
||
|
def __hash__(self):
|
||
|
return self.id
|
||
|
|
||
|
|
||
|
class Hardware(BaseModel):
|
||
|
id: int
|
||
|
identifier: str
|
||
|
name: str
|
||
|
hardware_type: HardwareType
|
||
|
|
||
|
def __hash__(self):
|
||
|
return self.id
|
||
|
|
||
|
|
||
|
class SensorType(BaseModel):
|
||
|
id: int
|
||
|
name: str
|
||
|
|
||
|
def __hash__(self):
|
||
|
return self.id
|
||
|
|
||
|
|
||
|
class Sensor(BaseModel):
|
||
|
id: int
|
||
|
hardware: Hardware
|
||
|
sensor_type: SensorType
|
||
|
identifier: str
|
||
|
name: str
|
||
|
index: int
|
||
|
is_default_hidden: bool
|
||
|
enabled: bool
|
||
|
|
||
|
def __hash__(self):
|
||
|
return self.id
|
||
|
|
||
|
|
||
|
class SensorValue(BaseModel):
|
||
|
sensor: Sensor
|
||
|
timestamp: datetime
|
||
|
value: str
|