def state_switches_delete(): if request.json is None: for switch in Register.POWERMOD_DATA.viewkeys(): PowerModHelper.remove_override_switch(switch) else: PowerModHelper.remove_override_switch(request.json) return state_switches_get()
def unblock_co2(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_CO2)
def unblock_filter(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_FILTER2)
def unblock_o2(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_O2)
def block_heater(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_HEATER)
def unblock_heater_led(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_HEATER_LED)
def unblock_filter(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_FILTER2)
def unblock(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_LIGHT2)
def unblock(): PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_LIGHT2)
def event(self): if not Register.LIRC_EVENTS: return lirc_event = LircEvents.get_event() if lirc_event == LircEvents.KEY_BACK: DisplayRegister.set_menuWindow() if lirc_event == LircEvents.KEY_RIGHT: self.selected_index = (self.selected_index + 1) % 8 self.redraw = True if lirc_event == LircEvents.KEY_LEFT: self.selected_index = (self.selected_index - 1) % 8 self.redraw = True if lirc_event == LircEvents.KEY_OK: if self.selected_index == 0: Filter1Logic.block_filter() Filter1Logic.toggle_filter() self.redraw = True if self.selected_index == 1: Filter2Logic.block_filter() Filter2Logic.toggle_filter() self.redraw = True if self.selected_index == 2: O2Logic.block_o2() O2Logic.toggle_o2() self.redraw = True if self.selected_index == 3: Co2Logic.block_co2() Co2Logic.toggle_co2() self.redraw = True if self.selected_index == 4: WaterTempLogic.block_heater() WaterTempLogic.toggle_heater() self.redraw = True if self.selected_index == 5: WaterTempLogic.block_heater_led() WaterTempLogic.toggle_heater_led() self.redraw = True if self.selected_index == 6: PowerModHelper.remove_override_switch( Register.I2C_POWERMOD_FILTER1) PowerModHelper.remove_override_switch( Register.I2C_POWERMOD_FILTER2) PowerModHelper.remove_override_switch( Register.I2C_POWERMOD_CO2) PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_O2) PowerModHelper.remove_override_switch( Register.I2C_POWERMOD_HEATER) PowerModHelper.remove_override_switch( Register.I2C_POWERMOD_HEATER_LED) if self.selected_index == 7: DisplayRegister.set_menuWindow()
def event(self): if not Register.LIRC_EVENTS: return lirc_event = LircEvents.get_event() if lirc_event == LircEvents.KEY_BACK: DisplayRegister.set_menuWindow() if lirc_event == LircEvents.KEY_RIGHT: self.selected_index = (self.selected_index + 1) % 8 self.redraw = True if lirc_event == LircEvents.KEY_LEFT: self.selected_index = (self.selected_index - 1) % 8 self.redraw = True if lirc_event == LircEvents.KEY_OK: if self.selected_index == 0: Filter1Logic.block_filter() Filter1Logic.toggle_filter() self.redraw = True if self.selected_index == 1: Filter2Logic.block_filter() Filter2Logic.toggle_filter() self.redraw = True if self.selected_index == 2: O2Logic.block_o2() O2Logic.toggle_o2() self.redraw = True if self.selected_index == 3: Co2Logic.block_co2() Co2Logic.toggle_co2() self.redraw = True if self.selected_index == 4: WaterTempLogic.block_heater() WaterTempLogic.toggle_heater() self.redraw = True if self.selected_index == 5: WaterTempLogic.block_heater_led() WaterTempLogic.toggle_heater_led() self.redraw = True if self.selected_index == 6: PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_FILTER1) PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_FILTER2) PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_CO2) PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_O2) PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_HEATER) PowerModHelper.remove_override_switch(Register.I2C_POWERMOD_HEATER_LED) if self.selected_index == 7: DisplayRegister.set_menuWindow()