2018-11-01 21:25:42 +01:00
|
|
|
from core.database.orm_framework import DBModel
|
2018-11-01 19:50:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
class ActorModel(DBModel):
|
2018-11-01 21:25:42 +01:00
|
|
|
__fields__ = ["name", "type", "config"]
|
2018-11-01 19:50:04 +01:00
|
|
|
__table_name__ = "actor"
|
|
|
|
__json_fields__ = ["config"]
|
|
|
|
|
|
|
|
|
|
|
|
class SensorModel(DBModel):
|
2018-11-01 21:25:42 +01:00
|
|
|
__fields__ = ["name", "type", "config"]
|
2018-11-01 19:50:04 +01:00
|
|
|
__table_name__ = "sensor"
|
2018-11-01 21:25:42 +01:00
|
|
|
__json_fields__ = ["config"]
|
2018-11-18 15:40:10 +01:00
|
|
|
|
|
|
|
class ConfigModel(DBModel):
|
|
|
|
__fields__ = ["type", "value", "description", "options"]
|
|
|
|
__table_name__ = "config"
|
|
|
|
__json_fields__ = ["options"]
|
|
|
|
__priamry_key__ = "name"
|
|
|
|
|
|
|
|
class KettleModel(DBModel):
|
|
|
|
__fields__ = ["name","sensor", "heater", "automatic", "logic", "config", "agitator", "target_temp"]
|
|
|
|
__table_name__ = "kettle"
|
|
|
|
__json_fields__ = ["config"]
|