Skip to content
New issue

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

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

Already on GitHub? # to your account

programactions.cgi not working as expected after bugfix #80 #84

Closed
smezger123 opened this issue Nov 6, 2023 · 7 comments
Closed

programactions.cgi not working as expected after bugfix #80 #84

smezger123 opened this issue Nov 6, 2023 · 7 comments
Labels

Comments

@smezger123
Copy link

smezger123 commented Nov 6, 2023

Thank you for fixing programactions.cgi in issue #80

But it´s still not working as expected. Even if you pass active=false in the URL, the program will be set to active=true (and same on setting visible)

http://192.168.1.xx/addons/xmlapi/programlist.cgi?sid=xxxxxx&program_id=6746&active=false&visible=false

@jens-maus
Copy link
Member

Well. it was only fix in the repo yet and not yet released, thus is not part of XML-API v2.2.

@smezger123
Copy link
Author

Yes, for sure. But i don´t want to wait for 2.4 until it´s finally working.

    string active = "} $active {";
    ...
    obj.Active(active);

active is now a string. Even the string value "false" will be casted to (bool)true

Thanks a lot!

@jens-maus
Copy link
Member

So what is the outcome now of this issue ticket here? Does the new programactions.cgi from the master branch works now for you or not? Because IMHO https://github.com/homematic-community/XML-API/blob/master/xmlapi/programactions.cgi#L34-L41 should work correctly. If not, point out the issue or submit a PR.

@jens-maus
Copy link
Member

@smezger123
Ok, after wiping out your sarcasm from your last comment I understood what you mean and I think commit 34e6744 should fix the issue. If not, open a new issue and explain in detail and without sarcasm or any other misleading comments. Thx for the hint.

@jens-maus jens-maus added the bug label Nov 7, 2023
@Maik2208
Copy link
Contributor

Maik2208 commented Nov 7, 2023

Hi @jens-maus
is the change really intended as implemented? Active and visible should be hard "true", regardless of wether "true" or "false" was passed?

@jens-maus
Copy link
Member

I think the change is intended yes. The point is that active is a string variable (have to be) but the obj.Active() function requires a boolean as @smezger123 pointed out. Thus the obj.Active(active == "true") line should perfectly convert the "true" string to a boolean and then pass that to the Active() function.

@Maik2208
Copy link
Contributor

Maik2208 commented Nov 7, 2023

Sorry, of course! My mistake

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants