Пример #1
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'dimmer', 'action')
        self.switch.add_level('off-press', 'off-press')
        self.switch.add_level('off-press-double', 'off-press-double')
        self.switch.add_level('off-press-triple', 'off-press-triple')
        self.switch.add_level('off-hold', 'off-hold')
        self.switch.add_level('off-hold-release', 'off-hold-release')
        self.switch.add_level('down-press', 'down-press')
        self.switch.add_level('down-press-double', 'down-press-double')
        self.switch.add_level('down-press-triple', 'down-press-triple')
        self.switch.add_level('down-hold', 'down-hold')
        self.switch.add_level('down-hold-release', 'down-hold-release')
        self.switch.add_level('up-press', 'up-press')
        self.switch.add_level('up-press-double', 'up-press-double')
        self.switch.add_level('up-press-triple', 'up-press-triple')
        self.switch.add_level('up-hold', 'up-hold')
        self.switch.add_level('up-hold-release', 'up-hold-release')
        self.switch.add_level('on-press', 'on-press')
        self.switch.add_level('on-press-double', 'on-press-double')
        self.switch.add_level('on-press-triple', 'on-press-triple')
        self.switch.add_level('on-hold', 'on-hold')
        self.switch.add_level('on-hold-release', 'on-hold-release')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        self.switch.disable_value_check_on_update()
        self.devices.append(self.switch)
        # Add dimmer
        self.dimmer = DimmerSwitch(devices, 'bright', 'brightness')
        self.devices.append(self.dimmer)
Пример #2
0
    def __init__(self, devices):
        super().__init__(devices)

        rotation_switch = SelectorSwitch(devices, 'rotate', 'rotation', ' (Rotation)')
        rotation_switch.add_level('Off', 'rotate_stop')
        rotation_switch.add_level('Left', 'rotate_left')
        rotation_switch.add_level('Right', 'rotate_right')
        rotation_switch.disable_value_check_on_update()

        self.devices.append(DimmerSwitch(devices, 'dimmer', 'brightness', ' (Level)'))
        self.devices.append(ToggleSwitch(devices, 'switch', 'click', ' (Switch)'))
        self.devices.append(rotation_switch)
Пример #3
0
    def __init__(self, devices):
        super().__init__(devices)

        button = SelectorSwitch(devices, 'click', 'click', ' (State)')
        button.add_level('Off', 'off')
        button.add_level('On', 'on')
        button.add_level('S1', 1)
        button.add_level('S2', 2)
        button.disable_value_check_on_update()

        self.devices.append(button)
        self.devices.append(DimmerSwitch(devices, 'light', 'brightness', ' (Brightness)'))
    def __init__(self):
        super().__init__()
        self.devices.append(DimmerSwitch('dimmer', 'brightness'))

        self.switch = SelectorSwitch('switch', 'action')
        self.switch.add_level('Off', 'off')
        self.switch.add_level('On', 'on')
        self.switch.add_level('Up', 'brightness_move_up')
        self.switch.add_level('Down', 'brightness_move_down')
        self.switch.add_level('Stop', 'brightness_stop')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        self.switch.disable_value_check_on_update()

        self.devices.append(self.switch)
Пример #5
0
    def __init__(self, devices):
        super().__init__(devices)
        self.click_actions = ['play_pause','skip_forward','skip_backward']

        rotation_switch = SelectorSwitch(devices, 'rotate', 'rotation', ' (Rotation)')
        rotation_switch.add_level('Left', 'rotate_left')
        rotation_switch.add_level('Off', 'rotate_stop')
        rotation_switch.add_level('Right', 'rotate_right')
        rotation_switch.disable_value_check_on_update()
        rotation_switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)

        control_switch = SelectorSwitch(devices, 'switch', 'click', ' (Switch)')
        control_switch.add_level('Backward', 'skip_forward')
        control_switch.add_level('PlayPause', 'play_pause')
        control_switch.add_level('Forward', 'skip_backward')
        control_switch.disable_value_check_on_update()
        control_switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)

        self.devices.append(DimmerSwitch(devices, 'dimmer', 'brightness', ' (Level)'))
        self.devices.append(rotation_switch)
        self.devices.append(control_switch)
 def __init__(self, devices):
     super().__init__(devices)
     self.devices.append(DimmerSwitch(devices, 'light', 'value'))
 def __init__(self, devices):
     super().__init__(devices)
     self.devices.append(DimmerSwitch(devices, 'dimmer', 'brightness'))
Пример #8
0
 def __init__(self):
     super().__init__()
     self.devices.append(DimmerSwitch('light', 'value'))