filename specification for running as a service
这个提交包含在:
父节点
a3e4b8839c
当前提交
34800bf5d9
@ -1,5 +1,8 @@
|
|||||||
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
db_file = os.path.join(os.path.dirname(__file__), '..', 'database.db')
|
||||||
|
|
||||||
|
|
||||||
def get_gui_radiator_data(topic):
|
def get_gui_radiator_data(topic):
|
||||||
return __storage__().get_gui_radiator_data(topic)
|
return __storage__().get_gui_radiator_data(topic)
|
||||||
@ -11,7 +14,7 @@ def set_gui_radiator_data(topic, away_mode, summer_mode, user_temperatur_setpoin
|
|||||||
|
|
||||||
class __storage__(object):
|
class __storage__(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.conn = sqlite3.connect("database.db")
|
self.conn = sqlite3.connect(db_file)
|
||||||
self.c = self.conn.cursor()
|
self.c = self.conn.cursor()
|
||||||
with self.conn:
|
with self.conn:
|
||||||
self.c.execute("""CREATE TABLE IF NOT EXISTS gui_radiator (
|
self.c.execute("""CREATE TABLE IF NOT EXISTS gui_radiator (
|
||||||
|
正在加载...
x
在新工单中引用
屏蔽一个用户