GithubHelp home page GithubHelp logo

dysomni / homebridge-dummy-radio-switch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukasroegner/homebridge-dummy-radio-switch

0.0 0.0 0.0 31 KB

Homebridge plugin that exposes a radio button selection with dummy switches.

License: MIT License

TypeScript 100.00%

homebridge-dummy-radio-switch's Introduction

homebridge-dummy-radio-switch

Homebridge plugin that exposes a radio button selection with dummy switches.

Each "radio group" can have several switches, only one switch can be enabled at a time. If a switched is turned ON, all other switches are turned OFF.

Installation

Please install the plugin with the following command:

npm install -g homebridge-dummy-radio-switch

Configuration

{
    "platforms": [
        {
            "platform": "DummyRadioSwitchPlatform",
            "groups": [
                {
                    "name": "<GROUP-NAME>",
                    "displayAsPowerStrip": false,
                    "switches": [
                        {
                            "name": "<SWITCH-NAME-1>",
                            "isDefaultOn": false,
                            "timeout": 0,
                            "nextOnSwitchName": null
                        },
                        {
                            "name": "<SWITCH-NAME-2>",
                            "isDefaultOn": false,
                            "timeout": 0,
                            "nextOnSwitchName": null
                        },
                        ...
                    ],
                    "timeout": 0
                }
            ]
        }
    ]
}

groups: Array of all groups of switches that should be exposed to HomeKit. Each group is a separate accessory.

name: The name of the group, that is initially used as the display name.

displayAsPowerStrip: If set to true, outlets instead of switches are exposed to HomeKit. This provides a more compact UI in the Apple Home app. Defaults to false.

switches: Array of all switches of the group.

name: The name of the switch.

isDefaultOn (optional): A single switch in a group can be defined as the "default on". If a switch in a group has this property set to true, the group acts as a radio button group that always has one option "selected". This means if all switches are set to OFF, the switch that is marked as "default on" is set to ON.

nextOnSwitchName (optional): The name of the switch (in the same group) that should be switched to ON if the current switch is switched OFF. This overwrites the "default on" behavior.

timeout (optional): If a value is set (in seconds), a timer is started when the "selection" changes. When the timer elapses, the "selection" is reset to the button that is marked as isDefaultOn. If no isDefaultOn button is provided, all are switched off. You can set a per-group timeout or multiple per-switch timeout values.

homebridge-dummy-radio-switch's People

Contributors

lukasroegner avatar donavanbecker avatar

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.