Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and direct implementors to use LowBatteryStatusAccessory #50

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.
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