Exemplo n.º 1
0
# Load our dependancies
from datetime import datetime
import PyISY
import ISYHelper
from ISYHelper import load_config, get_logger
from ISYHelper.Helpers import Helpers
from ISYHelper.REST import REST

from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.executors.pool import ProcessPoolExecutor

print('ISYHelper: Version %s Started: %s' % (VERSION, datetime.now()))

# Load the config file.
config = load_config()
print("This host IP is " + config['this_host']['host'])

# Start the log_file
logger = get_logger(config)

# TODO: Move into Devices/init
# Background scheduler for everyone to share.
#executors = {
#    'default': {'type': 'threadpool', 'max_workers': 20},
#    'processpool': ProcessPoolExecutor(max_workers=5)
#}
#job_defaults = {
#    'coalesce': False,
#    'max_instances': 2
#}
Exemplo n.º 2
0
# E.42 Added handlesigterm to __init__
from ISYHelper import load_config, handlesigterm
from ISYHelper.Helpers import Helpers
from ISYHelper.REST import REST

# E.42 Moved from background scheduler to the threading module.
THREADS = []

from apscheduler.schedulers.background import BackgroundScheduler

print("ISYHelper: Version %s Started: %s" % (VERSION, datetime.now()))

# Load the config file and logger from init.
# E.42 Added logger into the config loader.
config, logger = load_config()

# Start the log_file
# logger = get_logger(config)

# TODO: Move into Devices/init
# Background scheduler for everyone to share.
sched = BackgroundScheduler(logger=logger)

# Create the helpers now to catch config issues now.
if not "helpers" in config:
    print("ERROR: helpers not defined in config")
    exit(1)
try:
    helpers = Helpers(logger, sched, config["this_host"]["url"], config["helpers"])
except ValueError as e:
Exemplo n.º 3
0
# Load our dependancies
from datetime import datetime
import PyISY
import ISYHelper
from ISYHelper          import load_config,get_logger
from ISYHelper.Helpers  import Helpers
from ISYHelper.REST     import REST

from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.executors.pool import ProcessPoolExecutor

print('ISYHelper: Version %s Started: %s' % (VERSION, datetime.now()))

# Load the config file.
config = load_config();
print("This host IP is " + config['this_host']['host'])

# Start the log_file
logger = get_logger(config)

# TODO: Move into Devices/init
# Background scheduler for everyone to share.
#executors = {
#    'default': {'type': 'threadpool', 'max_workers': 20},
#    'processpool': ProcessPoolExecutor(max_workers=5)
#}
#job_defaults = {
#    'coalesce': False,
#    'max_instances': 2
#}