-
Notifications
You must be signed in to change notification settings - Fork 8
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
implement function validateCharacteristicValue #20
Conversation
fix code style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magst du dir den Diff mal ansehen? Kannst du ggf. die Änderungen vom Master noch mal pullen und in deinen Branch mergen? Zur Zeit entfernst du ein paar meiner Änderungen ;)
} | ||
|
||
if (is_int($value)) { | ||
if (!is_null($characteristics[$index]->getMinValue())) { /* Sollte reichen?! Wenn MinValue gesetzt ist, ist auch MaxValue gesetzt! */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich würde Min und Max Value jeweils komplett getrennt betrachten. Nicht, dass Apple das so nutzt, aber es wäre ggf. vollständiger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kein Problem, kann ich ja noch tun.
{ | ||
$this->type = $type; | ||
$this->requiredCharacteristics = $requiredCharacteristics; | ||
$this->optionalCharacteristics = $optionalCharacteristics; | ||
} | ||
|
||
public function setCharacteristic(int $instanceID, $value, HAPAccessory $accessory): void | ||
private function validateCharacteristicValue($instanceID, $value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du überprüfst zur Zeit gar nicht, ob der Typ der Variable dem entspricht was Apple erwartet, oder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reicht if (is_int($value)), if (is_bool($value)), if (is_float($value)) und if (is_string($value)) nicht?
Ja, ist mir auch aufgefallen, wollte erstmal deiner Überprüfung abwarten, passe das wieder an. :) |
No description provided.