KiboOst / php-devoloDHC

php API providing control over Devolo Home Control
MIT License
11 stars 0 forks source link

New function 'turnRuleOnOff' cURL error: Illegal characters found in URL #1

Closed spleijers closed 7 years ago

spleijers commented 7 years ago

Hi KiboOst,

First of all; Great work on this class! I saw that you made a version 2.0 with a new function 'turnRuleOnOff', that is fantastic! However, if I output the result form that function i get:

$result = $DHC->turnRuleOnOff($alarm_rulename, 0);
print_r($result);

//RESULT IS:
cURL error: Illegal characters found in URL

The Rule is however disabled....? How do I return a correct status?

Kind Regards, Sander

KiboOst commented 7 years ago

Hi, So, the function manage to disable the rule ? Could you share your rule name ? Does it have special characters ? So I can try a rule with same name here to reproduce/fix the bug.

Just tested with test rule named 'à@pré&ui' and no curl error here.

spleijers commented 7 years ago

Hi, Yes, the function disables the rule perfectly. The rule name is 'Alarm' (the standard name of the Alarm rule in DHC). Thanks!

KiboOst commented 7 years ago

Do you have this each time you run your script ? Can't reproduce it here.

KiboOst commented 7 years ago

I have updated the class with a few trick, let me know if it still happens. You can check $DHC->error after turnRuleOnOff just to be sure.

spleijers commented 7 years ago

Strange, somehow it seems to be working now. I believe it was caused by still using the old login:

$DHC = new DevoloDHC($login, $password, $localIP, $uuid, $gateway, $passkey);

With only the login and password the problem is gone XD