Code Monkey home page Code Monkey logo

Comments (3)

stas-demydiuk avatar stas-demydiuk commented on June 15, 2024

@salopette Sorry it's too hard to add support for this device without having one for testing. Hopefully someone with this device will help.

from domoticz-zigbee2mqtt-plugin.

d-EScape avatar d-EScape commented on June 15, 2024

I created an adapter to put the controller actions in a selector switch. Having the dimmer switch control an actual (Domoticz) dimmer slider seems pretty useless because you will need some event script anyway to control something else. Creating a slider would limit the functionality for scripting.

Sorry, my development environment is a mess... so no PR but some code to add:

file named 'dimmer_switch_phlps.py' in adapters/philips:

from adapters.adapter_with_battery import AdapterWithBattery
from devices.switch.selector_switch import SelectorSwitch

class DimmerSwitchPhlps(AdapterWithBattery):
    def __init__(self, devices):
        super().__init__(devices)

        self.switch = SelectorSwitch(devices, 'dimmer', 'action')
        self.switch.add_level('off', None)
        self.switch.add_level('down-press', 'down-press')
        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-hold', 'up-hold')
        self.switch.add_level('up-hold-release', 'up-hold-release')
        self.switch.add_level('on', 'on')
        self.switch.set_selector_style(SelectorSwitch.SELECTOR_TYPE_MENU)
        self.devices.append(self.switch)

Modify the adapters __init__.py accordingly with:
from adapters.philips.dimmer_switch_phlps import DimmerSwitchPhlps
and
'324131092621': DimmerSwitchPhlps, # Philips Hue dimmer switch

from domoticz-zigbee2mqtt-plugin.

stas-demydiuk avatar stas-demydiuk commented on June 15, 2024

@d-EScape Thanks! Added code to the main codebase

from domoticz-zigbee2mqtt-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.