summaryrefslogtreecommitdiff
path: root/heating.py
diff options
context:
space:
mode:
authorroot <root@turin.home>2022-01-22 16:47:15 +0000
committerroot <root@turin.home>2022-01-22 16:47:15 +0000
commitb6698810b9ff40a2d91b71c61017667642db212a (patch)
tree1c12debc99893ffc120f03c294bdf096497ae1e5 /heating.py
parent3245f4ddbd89c0f4cc5ef902bbdaead4e29cdac3 (diff)
Date functionality, inserting into sql
Diffstat (limited to 'heating.py')
-rw-r--r--heating.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/heating.py b/heating.py
index ab058d6..757f877 100644
--- a/heating.py
+++ b/heating.py
@@ -2,6 +2,7 @@ from abc import ABC, abstractmethod
from circular_queue import circular_queue
import time
import os
+import date
# Abstract Class for heating
class heating(ABC):
@@ -9,6 +10,7 @@ class heating(ABC):
self.temperature = 0
self.target = 19
self.on = False
+ self.date = date.date()
self.db = db
self.queue = circular_queue(20)
@@ -30,16 +32,14 @@ class heating(ABC):
else:
self.on = False
self.turn_off()
- """
self.db.exec(
"insert into temperature values (?,?,?,?)",
- (date, time, self.temperature, self.target),
+ (date.day(), date.time(), self.temperature, self.target),
)
self.db.exec(
"insert into history values (?,?,?)",
- (date, time, heatingon(int)),
+ (date.day(), date.time(), heatingon(int)),
)
- """
"""
Abstract methods used so that configuration for different