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

Enigma 2 Receiver #55

Open
Luftloch80 opened this issue Nov 16, 2016 · 3 comments
Open

Enigma 2 Receiver #55

Luftloch80 opened this issue Nov 16, 2016 · 3 comments

Comments

@Luftloch80
Copy link

Hi,
this is the Output when asking my sat reciever for its status
"false" if on
"true" if off

Is it possible to change the Habbit of status_url

@NovaGL
Copy link
Collaborator

NovaGL commented Nov 19, 2016

It is possible but not implemented. I have done it on some projects as a "hack"

The reason I haven't included it in this one is I hard coded it, various people want various options for on and off.

If someone could do a pull release that would include various options for on and off that would be great.

Here is how I would approach it.

var mapObj = {false:1,true:0, off:0, on:1};
            var re = new RegExp(Object.keys(mapObj).join("|"),"gi");
powerState = parseInt(powerState.replace(re, function(matched){return mapObj[matched];}));

You can look at a full example here of what I have done https://github.com/NovaGL/homebridge-openremote

@MrsDelish
Copy link
Contributor

How would it be just to set expected status-on/off in config.json
"statusOn": "true"
"statusOff": "false"
that way it could be configured to suit different needs.
I could probably write some code for it, if you want.

@NovaGL
Copy link
Collaborator

NovaGL commented Jan 11, 2017

Do a pull request and I will have a look you can't make it so it breaks it for people use 0 or 1

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

No branches or pull requests

3 participants