maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.12k stars 170 forks source link

Please add Status return value for char setter callback #120

Open d4rkmen opened 4 years ago

d4rkmen commented 4 years ago

In order to control operation status from setter. For example can send No answer status when sensor\anything else is unreachable. Or can return invalid value status for unsupported mode set Thanks

maximkulkin commented 4 years ago

How this is supposed to work?

What’s the use case?

d4rkmen commented 4 years ago

process_characteristics_update: HAPStatus status = HAPStatus_Success; ... if (ch->setter_ex) { status = ch->setter_ex(ch, h_value); ... return status;

Usecase is very important: when user made an action, which cannot be completed on device side, setter can return error status and (Siri) will report - cant access your device. Othervise it will be success (but actually its not) Lets say: your thermostat not supports cooling. User selected COOL and got success status. Or an actor device is connected by some interface (serial/network/spi/i2c) which not responds - same problem. For bridged acessories lost connection - same problem Etc etc. Thanks for your attention.