-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: main
Are you sure you want to change the base?
Custom binary sensor #162
Conversation
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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?