def __init__(self, devices):
        super().__init__(devices)

        self.switchLeft = SelectorSwitch(devices, 'btn', 'action',
                                         ' (Left Click)')
        self.switchLeft.add_level("Off", None)
        self.switchLeft.add_level('Click', 'left')
        self.switchLeft.add_level('Long click', 'left_long')
        self.switchLeft.add_level('Double click', 'left_double')
        self.switchLeft.disable_value_check_on_update()
        self.switchRight = SelectorSwitch(devices, 'btn_1', 'action',
                                          ' (Right Button)')
        self.switchRight.add_level("Off", None)
        self.switchRight.add_level('Click', 'right')
        self.switchRight.add_level('Long click', 'right_long')
        self.switchRight.add_level('Double click', 'right_double')
        self.switchRight.set_selector_style(
            SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.switchRight.disable_value_check_on_update()
        self.switchBoth = SelectorSwitch(devices, 'btn_2', 'action',
                                         ' (Both Buttons)')
        self.switchBoth.add_level("Off", None)
        self.switchBoth.add_level('Click', 'both')
        self.switchBoth.add_level('Long Click', 'both_long')
        self.switchBoth.add_level('Double Click', 'both_double')
        self.switchBoth.set_selector_style(
            SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.switchBoth.disable_value_check_on_update()

        self.devices.append(self.switchLeft)
        self.devices.append(self.switchRight)
        self.devices.append(self.switchBoth)
Ejemplo n.º 2
0
    def __init__(self, devices):
        super().__init__(devices)

        mode_switch = SelectorSwitch(devices, 'mode', 'system_mode', ' (Mode)')
        mode_switch.add_level('Off', 'off')
        mode_switch.add_level('Auto', 'auto')
        mode_switch.add_level('Manual', 'manual')
        mode_switch.add_level('Comfort', 'comfort')
        mode_switch.add_level('Eco', 'eco')
        mode_switch.add_level('Boost', 'boost')
        mode_switch.add_level('Complex', 'complex')
        mode_switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        mode_switch.set_icon(15)

        preset = SelectorSwitch(devices, 'preset', 'preset', ' (Preset)')
        preset.add_level('Away', 'away')
        preset.add_level('Schedule', 'schedule')
        preset.add_level('Manual', 'manual')
        preset.add_level('Comfort', 'comfort')
        preset.add_level('Eco', 'eco')
        preset.add_level('Boost', 'boost')
        preset.add_level('Complex', 'complex')
        preset.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        preset.set_icon(15)

        week_format = SelectorSwitch(devices, 'week', 'week', ' (Week Format)')
        week_format.add_level('5+2', '5+2')
        week_format.add_level('6+1', '6+1')
        week_format.add_level('7', '7')

        self.devices.append(mode_switch)
        self.devices.append(preset)
        self.devices.append(week_format)
        self.devices.append(
            SetPoint(devices, 'spoint', 'current_heating_setpoint',
                     ' (Setpoint)'))
        self.devices.append(
            SetPoint(devices, 'sp_eco', 'eco_temperature', ' (Eco Setpoint)'))
        self.devices.append(
            SetPoint(devices, 'sp_cmf', 'comfort_temperature',
                     ' (Comfort Setpoint)'))
        self.devices.append(
            TemperatureSensor(devices, 'temp', 'local_temperature',
                              ' (Temperature)'))
        self.devices.append(
            LevelSwitch(devices, 'level', 'position', ' (Valve position)'))
        self.devices.append(
            OnOffSwitch(devices, 'wnd', 'window_detection',
                        ' (Window Detection)'))
        self.devices.append(
            OnOffSwitch(devices, 'child', 'child_lock', ' (Child Lock)'))
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = ToggleSwitch(devices, 'switch', 'action')

        self.arrow_left = SelectorSwitch(devices, 'arrowL', 'action',
                                         ' (Left Arrow)')
        self.arrow_left.add_level('Off', None)
        self.arrow_left.add_level('Click', 'arrow_left_click')
        self.arrow_left.add_level('Hold', 'arrow_left_hold')
        self.arrow_left.add_level('Release', 'arrow_left_release')
        self.arrow_left.set_selector_style(
            SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.arrow_left.disable_value_check_on_update()

        self.arrow_right = SelectorSwitch(devices, 'arrowR', 'action',
                                          ' (Right Arrow)')
        self.arrow_right.add_level('Off', None)
        self.arrow_right.add_level('Click', 'arrow_right_click')
        self.arrow_right.add_level('Hold', 'arrow_right_hold')
        self.arrow_right.add_level('Release', 'arrow_right_release')
        self.arrow_right.set_selector_style(
            SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.arrow_right.disable_value_check_on_update()

        self.brightness_up = SelectorSwitch(devices, 'brUp', 'action',
                                            ' (Brightness Up)')
        self.brightness_up.add_level('Off', None)
        self.brightness_up.add_level('Click', 'brightness_up_click')
        self.brightness_up.add_level('Hold', 'brightness_up_hold')
        self.brightness_up.add_level('Release', 'brightness_up_release')
        self.brightness_up.set_selector_style(
            SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.brightness_up.disable_value_check_on_update()

        self.brightness_down = SelectorSwitch(devices, 'brDown', 'action',
                                              ' (Brightness Down)')
        self.brightness_down.add_level('Off', None)
        self.brightness_down.add_level('Click', 'brightness_down_click')
        self.brightness_down.add_level('Hold', 'brightness_down_hold')
        self.brightness_down.add_level('Release', 'brightness_down_release')
        self.brightness_down.set_selector_style(
            SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.brightness_down.disable_value_check_on_update()

        self.devices.append(self.switch)
        self.devices.append(self.arrow_left)
        self.devices.append(self.arrow_right)
        self.devices.append(self.brightness_up)
        self.devices.append(self.brightness_down)
    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.devices.append(self.switch)
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
    def __init__(self, devices):
        super().__init__(devices)

        mode_switch = SelectorSwitch(devices, 'mode', 'system_mode', ' (Mode)')
        mode_switch.add_level('Off', 'off')
        mode_switch.add_level('Auto', 'auto')
        mode_switch.add_level('Cool', 'cool')
        mode_switch.add_level('Heat', 'heat')
        mode_switch.add_level('Emergency Heating', 'emergency heating')
        mode_switch.add_level('Precooling', 'precooling')
        mode_switch.add_level('Fan only', 'fan only')
        mode_switch.add_level('Dry', 'dry')
        mode_switch.add_level('Sleep', 'sleep')
        mode_switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        mode_switch.set_icon(15)

        self.devices.append(
            TemperatureSensor(devices, 'temp', 'local_temperature',
                              ' (Temperature)'))
        self.devices.append(
            SetPoint(devices, 'sp1', 'occupied_heating_setpoint',
                     ' (Occupied Setpoint)'))
        self.devices.append(
            SetPoint(devices, 'sp2', 'unoccupied_heating_setpoint',
                     ' (Unoccupied Setpoint)'))
        self.devices.append(mode_switch)
    def __init__(self, devices):
        super().__init__(devices)
        self.devices.append(TemperatureSensor(devices, 'temp', 'temperature', 'temperature'))
        self.devices.append(HumiditySensor(devices, 'hum', 'humidity', ' (Humidity)'))
        self.devices.append(OnOffSwitch(devices, 'alarm', 'alarm', ' (Alarm)'))

        volume_switch = SelectorSwitch(devices, 'vol', 'volume', ' (Volume)')
        volume_switch.add_level('Low', 'low')
        volume_switch.add_level('Medium', 'medium')
        volume_switch.add_level('High', 'high')
        self.devices.append(volume_switch)

        melody_switch = SelectorSwitch(devices, 'mel', 'melody', ' (Melody)')
        for melody in range(1, 19):
            melody_switch.add_level(str(melody), melody)
       
        self.devices.append(melody_switch)       
Ejemplo n.º 8
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'click')
        self.switch.add_level('Up', 'open')
        self.switch.add_level('Down', 'close')

        self.devices.append(self.switch)
    def __init__(self, devices):
        super().__init__(devices)

        switch = SelectorSwitch(devices, 'btn', 'action')
        switch.add_level('Off', None)
        switch.add_level('Arm Away', 'arm_away')
        switch.add_level('Arm Stay', 'arm_stay')
        switch.add_level('Disarm', 'disarm')
        switch.add_level('Panic', 'panic')
        self.devices.append(switch)
Ejemplo n.º 10
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'click')
        self.switch.add_level('Off', None)
        self.switch.add_level('Switch 1', 'left')
        self.switch.add_level('Switch 2', 'right')
        self.switch.add_level('Both_Click', 'both')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)

        self.devices.append(self.switch)
Ejemplo n.º 11
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'KEF1PA', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Panic', 'panic')
        self.switch.add_level('Home', 'home')
        self.switch.add_level('Away', 'away')
        self.switch.add_level('Sleep', 'sleep')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        self.devices.append(self.switch)
Ejemplo n.º 12
0
    def create_button(self, devices, index):
        button = SelectorSwitch(devices, 'btn' + str(index), 'action', ' (Button ' + str(index) + ')')
        button.add_level('Off', None)
        button.add_level('On', 'on')
        button.add_level('Up', 'up-press')
        button.add_level('Down', 'down-press')
        button.add_level('Stop', 'stop')
        button.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        button.disable_value_check_on_update()

        return button
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'click')
        self.switch.add_level('Up', 'open')
        self.switch.add_level('Down', 'close')
        self.switch.add_level('Release', 'release')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.switch.disable_value_check_on_update()

        self.devices.append(self.switch)
Ejemplo n.º 14
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'Remote', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Arm all zones', 'arm_all_zones')
        self.switch.add_level('Arm partial zones', 'arm_partial_zones')
        self.switch.add_level('Disarm', 'disarm')
        self.switch.add_level('Emergency', 'emergency')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        self.devices.append(self.switch)
Ejemplo n.º 15
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'action', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Click', 'single')
        self.switch.add_level('Double Click', 'double')
        self.switch.add_level('Hold', 'hold')
        self.switch.disable_value_check_on_update()

        self.devices.append(self.switch)
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'action', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Vibration', 'vibration')
        self.switch.add_level('Drop', 'drop')
        self.switch.add_level('Tilt', 'tilt')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)

        self.devices.append(self.switch)
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'click')
        #self.switch.add_level('On', 'open')
        #self.switch.add_level('Off', 'close')
        #self.switch.add_level('None', '')
        self.switch.add_level('Up', 'open')
        self.switch.add_level('Down', 'close')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)

        self.devices.append(self.switch)
    def create_button(self, devices, index):
        action_prefix = 'button_' + str(index) + '_'
        button = SelectorSwitch(devices, 'btn' + str(index), 'action',
                                ' (Button ' + str(index) + ')')
        button.add_level('Off', None)
        button.add_level('Click', action_prefix + 'single')
        button.add_level('Hold', action_prefix + 'hold')
        button.add_level('Release', action_prefix + 'release')
        button.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        button.disable_value_check_on_update()

        return button
Ejemplo n.º 19
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, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'click')
        self.switch.add_level('Off', 'off')
        self.switch.add_level('On', 'on')
        self.switch.add_level('Up', 'brightness_up')
        self.switch.add_level('Down', 'brightness_down')
        self.switch.add_level('Stop', 'brightness_stop')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)

        self.devices.append(self.switch)
Ejemplo n.º 21
0
    def init(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'state')
        self.switch.add_level('Off', None)
        self.switch.add_level('Click', 'single')
        self.switch.add_level('Double Click', 'double')
        self.switch.add_level('Hold', 'hold')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        self.switch.disable_value_check_on_update()

        self.devices.append(self.switch)
Ejemplo n.º 22
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)
Ejemplo n.º 23
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)
Ejemplo n.º 24
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Click', 'single')
        self.switch.add_level('Double Click', 'double')
        self.switch.add_level('Long Press', 'long')

        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        self.switch.disable_value_check_on_update()

        self.devices.append(self.switch)
Ejemplo n.º 25
0
    def create_button(self, devices, name):
        action_prefix = name + '_'
        device = SelectorSwitch(devices, 'btn_' + name[0], 'action_' + name, ' (' + name.capitalize() + ' Button)')
        device.add_level('Off', None)
        device.add_level('Click', action_prefix + 'single')
        device.add_level('Double', action_prefix + 'double')
        device.add_level('Triple', action_prefix + 'triple')
        device.add_level('Hold', action_prefix + 'hold')
        device.add_level('Release', action_prefix + 'release')
        device.set_selector_style(SelectorSwitch.SELECTOR_TYPE_BUTTONS)
        device.disable_value_check_on_update()

        return device
Ejemplo n.º 26
0
    def __init__(self, devices):
        super().__init__(devices)
        
        selector = SelectorSwitch(devices, 'click', 'click')
        selector.add_level('Off', None)
        selector.add_level('Left', 'left')
        selector.add_level('Right', 'right')
        selector.add_level('Both', 'both')
        selector.disable_value_check_on_update()

        self.devices.append(OnOffSwitch(devices, 'left', 'state_left'))
        self.devices.append(OnOffSwitch(devices, 'right', 'state_right'))
        self.devices.append(selector)
    def __init__(self):
        super().__init__()

        self.switch = SelectorSwitch('action', 'action')
        self.switch.add_level('Off', None)
        self.switch.add_level('Vibration', 'vibration')
        self.switch.add_level('Drop', 'drop')
        self.switch.add_level('Tilt', 'tilt')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)

        self.devices.append(self.switch)
        self.devices.append(CustomSensor('stgth', 'strength', ' (Strength)'))
        self.devices.append(JSONSensor('angle', 'angle_raw', ' (Angle)'))
Ejemplo n.º 28
0
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'switch', 'state')
        self.switch.add_level('Off', None)
        self.switch.add_level('Click', 'single')
        self.switch.add_level('Double Click', 'double')
        self.switch.add_level('Shake', 'shake')
        self.switch.add_level('Hold', 'hold')
        self.switch.add_level('Release', 'release')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)

        self.devices.append(self.switch)
Ejemplo n.º 29
0
    def _add_selector_device(self, alias, feature, device_name_suffix = ''):
        suffix = device_name_suffix if device_name_suffix != '' else (' (' + feature['name'] + ')')
        device = SelectorSwitch(domoticz.get_devices(), alias, feature['property'], suffix)
        device.disable_value_check_on_update()
        device.add_level('Off', None)
        for value in feature['values']:
            device.add_level(value, value)

        if (len(feature['values']) >= 5):
            device.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)

        device.feature = feature

        self.devices.append(device)
    def __init__(self):
        super().__init__()

        sensitivity_switch = SelectorSwitch('sens', 'sensitivity',
                                            ' (Sensivity)')
        sensitivity_switch.add_level('Low', 'low')
        sensitivity_switch.add_level('Medium', 'medium')
        sensitivity_switch.add_level('High', 'high')

        self.devices.append(SmokeSensor('smoke', 'smoke'))
        self.devices.append(OnOffSwitch('test', 'test_state', ' (Test)'))
        self.devices.append(sensitivity_switch)
        self.devices.append(
            CustomSensor('dnsty', 'smoke_density', ' (Smoke Density)'))