Compare commits
No commits in common. "debc535c9f70e26b1cf9c71e60c93bddb3e7c38f" and "4e25b921c45a9019a62fa28b934c0e6e857b8b81" have entirely different histories.
debc535c9f
...
4e25b921c4
@ -35,7 +35,7 @@
|
|||||||
{
|
{
|
||||||
"id": "3",
|
"id": "3",
|
||||||
"autostate": false,
|
"autostate": false,
|
||||||
"pin": "37",
|
"pin": "27",
|
||||||
"times": [
|
"times": [
|
||||||
{
|
{
|
||||||
"on_time": "7:40",
|
"on_time": "7:40",
|
||||||
|
@ -47,9 +47,11 @@ class Control(threading.Thread):
|
|||||||
for entry in self.__config['water']:
|
for entry in self.__config['water']:
|
||||||
pin = int(entry['pin'])
|
pin = int(entry['pin'])
|
||||||
GPIO.setup(pin, GPIO.OUT)
|
GPIO.setup(pin, GPIO.OUT)
|
||||||
|
GPIO.output(pin, 1)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.load_config()
|
self.load_config()
|
||||||
|
self.__heat.off()
|
||||||
self.__heat.start()
|
self.__heat.start()
|
||||||
while self.__run_condition:
|
while self.__run_condition:
|
||||||
if self.__trigger_read_config:
|
if self.__trigger_read_config:
|
||||||
|
@ -10,8 +10,8 @@ LOG_FILE = "/var/log/sauna.log"
|
|||||||
LOG_FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
LOG_FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# logging.basicConfig(format=LOG_FORMAT, level=LOG_LEVEL, filename=LOG_FILE)
|
logging.basicConfig(format=LOG_FORMAT, level=LOG_LEVEL, filename=LOG_FILE)
|
||||||
logging.basicConfig(format=LOG_FORMAT, level=LOG_LEVEL)
|
# logging.basicConfig(format=LOG_FORMAT, level=LOG_LEVEL)
|
||||||
|
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
config_file = os.path.join(os.path.expanduser('~'), ".config/gardencontrol/config.json")
|
config_file = os.path.join(os.path.expanduser('~'), ".config/gardencontrol/config.json")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import xmlrpc
|
from xmlrpc.server import SimpleXMLRPCServer
|
||||||
import config
|
import config
|
||||||
import control
|
import control
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ class Remotecontrol():
|
|||||||
self.__config = config.Config(configfile)
|
self.__config = config.Config(configfile)
|
||||||
|
|
||||||
host = (self.__config.hostinfo())
|
host = (self.__config.hostinfo())
|
||||||
self.__server = xmlrpc.server.SimpleXMLRPCServer(host, allow_none=True)
|
self.__server = SimpleXMLRPCServer(host, allow_none=True)
|
||||||
self.__control = control.Control(configfile)
|
self.__control = control.Control(configfile)
|
||||||
|
|
||||||
self.__server.register_function(self.set_water_autostate, 'set_water_autostate')
|
self.__server.register_function(self.set_water_autostate, 'set_water_autostate')
|
||||||
|
Loading…
Reference in New Issue
Block a user