Skip to content

BoolCharacteristic value #65

@beckmx

Description

@beckmx

@etwmc I am using the latest version of iOS10.2 beta, and realize that the boolCharacteristic never gets fired with "true" statements. So I was debugging the code and realized it returns "true" or "false" on the first time PHK startup, but after that, the "home" app just sends "1" or "0", this is a little fix I implemented to understand both ways, it should be placed in the PHKAccessory.h:

virtual void setValue(string str) {
        bool newValue = false;
        if(strncmp("true", str.c_str(), 4)==0 || strncmp("1", str.c_str(), 1)==0){
	   newValue=true;
	}
        if (valueChangeFunctionCall)
            valueChangeFunctionCall(_value, newValue);
        _value = newValue;
    }

Greetings!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions