etwmc / Personal-HomeKit-HAP

This project will provide source code to build a HomeKit support accessories.
MIT License
236 stars 85 forks source link

bad args in Accessory.cpp #54

Closed steveb48 closed 8 years ago

steveb48 commented 8 years ago

PowerState is based on boolean and brightnessState is based on int but they both call changeLightIntensity which accepts int. I think you want something like changePowerState which accepts booleans.

boolCharacteristics *powerState = new boolCharacteristics(charType_on, premission_read|premission_write|premission_notify); powerState->setValue("true"); powerState->valueChangeFunctionCall = &changeLightIntensity; lightAcc->addCharacteristics(lightService, powerState);

intCharacteristics *brightnessState = new intCharacteristics(charType_brightness, premission_read|premission_write|premission_notify, 0, 100, 1, unit_percentage);
brightnessState->setValue("50");
brightnessState->valueChangeFunctionCall = &changeLightIntensity;
lightAcc->addCharacteristics(lightService, brightnessState);
steveb48 commented 8 years ago

Looks like this is fixed now. Thanks!