hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
153 stars 82 forks source link

refactor battery status to an optional characteristic #75

Closed ccutrer closed 4 years ago

ccutrer commented 5 years ago

rather than have everyone implement an interface directly for every concrete accessory

also refactor in an AbstractSensor[Service] base class/interface so taht all the different sensors don't have to repeat their optional characteristics

sobeos commented 4 years ago

I would keep the architecture more open. Introducing a sensor interface would restrict the setup too much. I would introduce an interface for every characteristic, because there are numerous combinations. I understand the idea behind, but I fear it will not work for all accessories. Perhaps somebody has an idea to solve the problem. If not, I would copy the impl part for every class providing the optional characteristic. (most of the time not too many)