Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ia7 direct control for items with more than 2 states #748

Merged
merged 3 commits into from
Feb 19, 2018

Conversation

tobser
Copy link
Contributor

@tobser tobser commented Feb 11, 2018

Pull request also contains a small fix to raZberry.pm and ia7.

The main change this introduced here is a new ia7_config.json setting "direct_control_states" to specify the states for a direct controlled item:

    "Item_with_too_Many_States" : {
        "direct_control_states": [
            "on",
            "off"
        ],
        "direct_control": "yes"
    },

Tobias Sachs added 3 commits February 11, 2018 10:12
Before the the click event was bound $NumberOfButtons times.
- move direct control handling code into seperate function
  "direct_control"
- introduce new ia7_config.json setting "direct_control_states" to
  specify the states for a direct controled item:

        "Item_with_too_Many_States" : {
            "direct_control_states": [
                "on",
                "off"
            ],
            "direct_control": "yes"
        },
@hplato
Copy link
Collaborator

hplato commented Feb 12, 2018

Ah, so the direct_control_states are the toggle, but that allows for other states to be present such as dim levels?

How does this show up in the IA7 user editable config file?

@tobser
Copy link
Contributor Author

tobser commented Feb 14, 2018

The item can have other states too. On click the new state will be set to the first state in direct_control_states. E.g. if the item has the following configuration:

   "test_item" : {                                                                                                                         
        "direct_control_states": [                                                                                                          
             "off",                                                                                                                          
            "on"                                                                                                                            
         ],                                                                                                                                  
         "direct_control": "yes"                                                                                                             
    },

and its current state is "20%" it will be changed to "off" when clicked.

here is a screenshot of the editor with one of my test items
image

@hplato
Copy link
Collaborator

hplato commented Feb 19, 2018

Neat. We'll have to update the wiki with the new 5.1 ia7_config.json file.

@hplato hplato merged commit f1ab944 into hollie:master Feb 19, 2018
@hplato hplato mentioned this pull request Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants