def init_blinker(self): app = self.config.get_param('current_appliance') if app == 'appliance1' or app == 'appliance2': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path")) elif app == 'dummy': self.blinker = blinker_factory.get_blinker(app) else: self.logger.error("Unrecognised appliance name: "+str(app))
def _init_blinker(self): #local config overwrites global, if exists app = self.config.get_param('current_appliance') if len(app) == 0: app = settings.current_appliance() self.config.set_param('current_appliance', app) if app == 'appliance1': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path")) elif app == 'appliance2': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path"), int(self.config.get_param("intensity"))) elif app == 'dummy': self.blinker = blinker_factory.get_blinker(app) else: self.logger.error("Unrecognised appliance name: " + str(app))
def _init_blinker(self): #local config overwrites global, if exists app = self.config.get_param('current_appliance') if len(app) == 0: app = settings.current_appliance() self.config.set_param('current_appliance', app) if app == 'appliance1': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path")) elif app == 'appliance2': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path"), int(self.config.get_param("intensity"))) elif app == 'dummy': self.blinker = blinker_factory.get_blinker(app) else: self.logger.error("Unrecognised appliance name: "+str(app))
def _init_blinker(self): #local config overwrites global, if exists app = self.config.get_param('current_appliance') if len(app) == 0: app = settings.current_appliance() self.config.set_param('current_appliance', app) if app == 'appliance1': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path")) elif app == 'appliance2': self.blinker = blinker_factory.get_blinker( app, self.config.get_param("device_path"), int(self.config.get_param("intensity"))) time.sleep(1) #TODO - without it if just-after _init_blinker freqs will be sent - it will not work (possibly there m elif app == 'dummy': self.blinker = blinker_factory.get_blinker(app) else: self.logger.error("Unrecognised appliance name: "+str(app))
def __init__(self, appliance_type, dev_path, intensity): self.status = None if len(appliance_type) == 0: appliance_type = settings.current_appliance() self._blinker = blinker_factory.get_blinker(appliance_type, dev_path, intensity) assert(self._blinker is not None) #initial values self._size = 8 self._curr_values = [-1]*8 #white #initial blinker parameters; to be setable in the future self._d1 = 1 self._d2 = 1 self._reset_values()
def __init__(self, appliance_type, dev_path, intensity): self.status = None if len(appliance_type) == 0: appliance_type = settings.current_appliance() self._blinker = blinker_factory.get_blinker(appliance_type, dev_path, intensity) assert (self._blinker is not None) #initial values self._size = 8 self._curr_values = [-1] * 8 #white #initial blinker parameters; to be setable in the future self._d1 = 1 self._d2 = 1 self._reset_values()