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

Custom binary sensor #162

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

north3221
Copy link
Contributor

I've created this to compliment the custom sensors, so we can have binary sensors for some of the heat pump variables.

Needs a bit of a review, its generally fine I think apart from how I am handling the call to process the message, currently with an type (int) variable. If we think that's a good way of doing it, could firm that up with an enum, but interested on if there is a view of a better way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@atanasenko @lanwin interested on what you think the best way to handle the different custom sensor types is? If you think this way is ok I could create as enum, but any better ideas?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. In main I removed the custom parameter compleatly and just call set_custom_sensor every time. If there is no custom sensor, this does nothing.

So the best would be if you do the same.

Copy link
Collaborator

@lanwin lanwin left a comment

Choose a reason for hiding this comment

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

Can you please also add an example to the example.yaml

return optional<std::set<uint16_t>>();
}

void /*MessageTarget::*/ set_custom_binary_sensor(const std::string address, uint16_t message_number, bool value) override
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please check the indentation here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. In main I removed the custom parameter compleatly and just call set_custom_sensor every time. If there is no custom sensor, this does nothing.

So the best would be if you do the same.

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