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

Give a name to new Characterics enums #839

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

frankonski
Copy link
Contributor

Hopefully a small change that can be cherry-picked into a 1.9.1 release.

Give a type to these enums, so the can be re-used as return type, such as returning the security alarm state itself rather than its integer value:

  Characteristic::SecuritySystemCurrentState::SecuritySystemCurrentStateEnum_t getState() {
    return partitionCurrentState->getVal<Characteristic::SecuritySystemCurrentState::SecuritySystemCurrentStateEnum_t>();
  }

Also allows better Intellisense help when hovering over enum values which now shows:

enum Characteristic::SecuritySystemCurrentState::SecuritySystemCurrentStateEnum_t::DISARMED = 3

or

enum Characteristic::ContactSensorState::ContactSensorStateEnum_t::DETECTED = 0

instead of

enum Characteristic::SecuritySystemCurrentState::<unnamed>::DISARMED = 3

and

enum Characteristic::ContactSensorState::<unnamed>::DETECTED = 0

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.

None yet

1 participant