brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

Add optional characteristics issue #137 #138

Closed rbg closed 5 years ago

rbg commented 5 years ago

updated template to include optionals.

I did consider adding an additional function to add the optional characteristics and if that is preferred i can regenerate the PR to reflect that..

destari commented 5 years ago

Nice!

brutella commented 5 years ago

Thanks for the PR. I do have some concerns with these changes.

Optional characteristics should be optional. If people upgrade to a new version of hc, they would automatically get new characteristics attached to their accessories. Even when they don't need them.

The current service implementations only includes the required characteristics. That's because I wanted to provide only the bare minimum. If people wanted to have more characteristics, they could create their own service structs.

We have to decide to either include only the requirement characteristics (that's how it's currently done) or all characteristics.

I leaning towards the current implementation to only include the required characteristics. What's your take on that?

rbg commented 5 years ago

Yes i had the concern too -- I will generate another PR that adds the Optional characteristics to the structs and an new function to add. So it will keep current require characteristics and the user will have the option for the optional , thus no surprises. Please hold for the next available PR :)