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

implement function validateCharacteristicValue #20

Closed
wants to merge 10 commits into from
Closed

implement function validateCharacteristicValue #20

wants to merge 10 commits into from

Conversation

Schnittcher
Copy link
Contributor

No description provided.

@Schnittcher
Copy link
Contributor Author

fix code style

Copy link
Owner

@paresy paresy left a 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! */
Copy link
Owner

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.

Copy link
Contributor Author

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)
Copy link
Owner

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?

Copy link
Contributor Author

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?

@Schnittcher
Copy link
Contributor Author

Ja, ist mir auch aufgefallen, wollte erstmal deiner Überprüfung abwarten, passe das wieder an. :)

@Schnittcher Schnittcher deleted the feature/validateValues branch August 28, 2017 08:40
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

Successfully merging this pull request may close these issues.

2 participants