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

Battery's charging_state and battery_level characteristics are defined as optional even though they're required. #64

Closed
gbaranski opened this issue Jan 14, 2022 · 3 comments

Comments

@gbaranski
Copy link

you can find that here

https://github.com/ewilken/hap-rs/blob/main/src/service/generated/battery.rs#L34-L37

And according to the specification, those two are required.
Screenshot 2022-01-14 at 18 36 24

@ewilken
Copy link
Owner

ewilken commented Jan 20, 2022

Thanks for checking! I just re-ran the codegen under macOS 12.0.1 and it generated the two characteristics as optional. So Apple's own implementation in macOS ist diverging from the spec here. Are you reading the latest version of the spec? And is the iOS controller complaining (read: not pairing) about our implementation? If it works, I'd say let's just stick with replicating Apple's implementation and call it a day.

@gbaranski
Copy link
Author

Are you reading the latest version of the spec?

Yes, I think so.

And is the iOS controller complaining (read: not pairing) about our implementation?

It does connect, but it seemed weird.

Thanks for clarifying, should I keep the issue open?

@ewilken
Copy link
Owner

ewilken commented Feb 18, 2022

I'd say let's close it. But please feel free to reopen should you run into any related issues!

@ewilken ewilken closed this as completed Feb 18, 2022
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

No branches or pull requests

2 participants