hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
152 stars 83 forks source link

Add and direct implementors to use LowBatteryStatusAccessory #50

Closed timcharper closed 5 years ago

timcharper commented 5 years ago

BatteryAccessory is used only by BatteryService and does not apply to MotionSensor, SmokeSensor, etc.

Deprecate BatteryAccessory and leave the implementation for BatteryService / Battery for a future date. Log a warning for accessories that are still trying to use it.

timcharper commented 5 years ago

Here's where BatteryLevel is actually used: https://github.com/KhaosT/HAP-NodeJS/blob/a4f806d/lib/gen/HomeKitTypes.js#L2730

From what I gather, it is for stand-alone batteries. Registering a BatteryLevel characteristic with MotionSensor / SmokeSensor / etc. is invalid and the characteristic gets ignored. I've confirmed that LowBatteryStatus does work.