Skip to content

Conversation

@timcharper
Copy link
Contributor

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
Copy link
Contributor Author

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.

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 timcharper force-pushed the tharper/fix-battery-reporting-for-devices branch from f256273 to 819a5c2 Compare January 2, 2019 08:41
Copy link
Collaborator

@andylintner andylintner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@andylintner andylintner merged commit 683a362 into hap-java:master Jan 6, 2019
@timcharper timcharper deleted the tharper/fix-battery-reporting-for-devices branch January 21, 2019 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants