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
How to declare a switch? #293
Comments
I use ShellSwitch:
|
|
what purpose is your switch for? this creates an array of two buttons as shown here : these buttons can be switched on the gui and can be executed with a shellscript or shell command. instead of a buttonsdevice you can use the class shellswitch to create on / off instead of a pushbutton. |
Right now I'm just prototyping and putting pieces together. What I wanted to have was one of the demo's on/off switches that indicates its switching state.
I understand the From Can I achieve something like the demo's on/off button the way I'm approaching it? |
Use @wutu s example. |
Does not work on Windows as |
I added support for Dummy devices: {
"class": "DummySwitch",
"id": "dummy-switch",
"name": "Dummy Switch"
},
{
"class": "DummyDimmer",
"id": "dummy-dimmer",
"name": "Dummy Dimmer"
},
{
"class": "DummyShutter",
"id": "dummy-shutter",
"name": "Dummy Shutter"
} |
Verry nice, wgoing to test it right away :) |
I used the code sweetpi poste but it dont work for me. Must i add a special plugin or a state to the Dummys? On wich pimatic version it should work? |
Tried to replace my shellswitch by a dummy one, but some rules fail now:
and the rule is
The rule was working fine before replacing shellswitch by dummyswitch |
Should now (pimatic v0.8.19) be fixed. Keep in mind the dummy devices do currently not remember state on restart...I'm working on it. I really want to ban
pimatic v0.8.18 or later |
Update: In pimatic v0.8.20 the state of all dummy device gets restored to the last state on startup. |
Yes it is |
@sweetpi you rock! |
When I add this to my config:
I get this error:
I have pimatic v0.8.20 installed :-/ |
Do you have another device with the same |
no, I checked that already |
Could you please activate debug logging (#137) and post the stack trace? |
should have done that already..
|
okay, seems like the error How can I make a rule like this or how can I escape the quotes?
|
Unfortunately it's not possible, yet. Could you make a new request issue for that, so it does not get lost :) |
Should be fixed in pimatic v0.8.21. Could you please test? |
working thanks! :) Will create a new issue ;-) |
Out of curiosity for the benefit of learning: why are the promises of the dummy devices not resolved with a value |
Dou you want to know, why the |
I was confused why
returns an empty promise. On second thought this is of course the setter, not the getter. Wondering if it would be good practice to return |
I had actions (/setter) return the new state in the beginning, but then decided against it, because I didn't find a scenario where it could be helpful and so it is just another thing plugin authors would have to think about. Chainable JavaScript interfaces (like JQuery is doing it) are very cool. But I think there is no scenario where it would be so much helpful, that it makes sense that every device must concern about it. I had a cool idea for scripting rules in JS/CS for advanced people recently. Would be really cool to have the ability to build rules like this in JS/CS:
But I think for this we need to wrap devices into another object anyway... btw: Very nice presentation about DSLs in JS: http://www.youtube.com/watch?v=lm4jEcnWeKI |
Playing around with DummyDevices I can almost achieve what I have in mind. I am just wondering if there's a way to declare a "Dummy Contact" open/close |
Running 0.8.16 I'm having touble creating a switch:
Any ideas? Classname is copied from
devices.coffee
?The text was updated successfully, but these errors were encountered: