Ejemplo n.º 1
0
 def __init__(self):
     """ Regular init stuff """
     self.init_complete = False
     self.name = "p00_main"
     self.handlers = []
     self.msg_in = Message()
     self.msg_to_process = Message()
     self.msg_to_send = Message()
     self.last_hb = datetime.datetime.now()
     self.in_msg_loop = True
     self.main_loop = True
     self.p00_queue = multiprocessing.Queue(-1)
     self.work_queue = multiprocessing.Queue(-1)
     self.log_queue = multiprocessing.Queue(-1)
     self.close_pending = False
     self.process_path = os.path.dirname(os.path.abspath(__file__))
     self.enable = [
         True, True, True, False, False, False, False, False, False, False,
         False, True, False, True, False, True, True, True
     ]
     self.nest_username = str()
     self.nest_password = str()
     # Initialize logging
     worker_configurer(self.log_queue)
     self.logger = logging.getLogger(__name__)
     # Spawn individual processes
     self.create_log_process()
     self.create_gui_process()
     self.create_logic_process()
     self.create_home_process()
     self.create_screen_process()
     self.create_wemo_process()
     self.create_nest_process()
     self.update_gui()
     self.init_complete = True
Ejemplo n.º 2
0
 def __init__(self, in_queue, out_queue, log_queue, **kwargs):
     self.msg_in_queue = in_queue
     self.msg_out_queue = out_queue
     # Initialize logging
     worker_configurer(log_queue)
     self.logger = logging.getLogger(__name__)
     # Set default input parameter values
     self.name = "undefined"
     # Update default elements based on any parameters passed in
     if kwargs is not None:
         for key, value in kwargs.items():
             if key == "name":
                 self.name = value
     # Initialize parent class
     multiprocessing.Process.__init__(self, name=self.name)
     # Create remaining class elements
     self.work_queue_empty = True
     self.work_queue = multiprocessing.Queue(-1)
     self.msg_in = message.Message()
     self.msg_in_empty = True
     self.msg_to_process = message.Message()
     self.msg_to_send = message.Message()
     self.last_hb = datetime.datetime.now()
     self.in_msg_loop = bool()
     self.main_loop = bool()
     self.device = None
     self.device_list = []
     self.index = 0
     self.last_update = datetime.datetime.now()
     self.close_pending = False
Ejemplo n.º 3
0
 def __init__(self, in_queue, out_queue, log_queue, **kwargs):
     self.msg_in_queue = in_queue
     self.msg_out_queue = out_queue
     # Initialize logging
     worker_configurer(log_queue)
     self.logger = logging.getLogger(__name__)
     # Set default input parameter values
     self.name = "undefined"
     # Update default elements based on any parameters passed in
     if kwargs is not None:
         for key, value in kwargs.items():
             if key == "name":
                 self.name = value
     # Initialize parent class
     multiprocessing.Process.__init__(self, name=self.name)
     # Create remaining class elements
     self.work_queue = multiprocessing.Queue(-1)
     self.msg_in = message.Message()
     self.msg_to_process = message.Message()
     self.msg_to_send = message.Message()
     self.last_hb = datetime.datetime.now()
     self.last_forecast_update = datetime.datetime.now(
     ) + datetime.timedelta(minutes=-15)
     self.dst = dst.USdst()
     self.utc_offset = datetime.timedelta(hours=0)
     self.in_msg_loop = bool()
     self.main_loop = bool()
     self.close_pending = False
     self.create_home_flags()
Ejemplo n.º 4
0
 def __init__(self, in_queue, out_queue, log_queue, **kwargs):
     self.msg_in_queue = in_queue
     self.msg_out_queue = out_queue
     # Initialize logging
     worker_configurer(log_queue)
     self.logger = logging.getLogger(__name__)
     # Set default input parameter values
     self.name = "undefined"
     self.logfile = "logfile"
     # Update default elements based on any parameters passed in
     if kwargs is not None:
         for key, value in kwargs.items():
             if key == "name":
                 self.name = value
     # Initialize parent class
     multiprocessing.Process.__init__(self, name=self.name)
     # Create remaining class elements
     self.username = str()
     self.password = str()
     self.work_queue = multiprocessing.Queue(-1)
     self.msg_in = message.Message()
     self.msg_to_process = message.Message()
     self.msg_to_send = message.Message()
     self.last_hb = datetime.datetime.now()
     self.in_msg_loop = bool()
     self.main_loop = bool()
     self.close_pending = False
     self.structure = []
     self.current_condition = str()
     self.current_temp = str()
     self.current_wind_dir = str()
     self.current_humid = str()
     self.result = str()
     self.forecast = []
     self.forecast_condition = str()
     self.forecast_temp_low = str()
     self.forecast_temp_high = str()
     self.forecast_humid = str()