-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
north3221
wants to merge
21
commits into
omerfaruk-aran:main
Choose a base branch
from
north3221:custom_binary_sensor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Custom binary sensor #162
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0cc4ef6
initial commit
north3221 6445d8c
added binary sensor import
north3221 6730f6b
fixing missing
north3221 865940d
fixing missing
north3221 ca08349
fixing missing
north3221 186ccf6
fixing missing
north3221 f0e5f9b
fixing missing
north3221 a54deb7
fixing missing
north3221 953331d
fixing missing
north3221 eb4ce28
fixing missing
north3221 1f2e907
fixing missing
north3221 4446bea
fixing missing
north3221 ae26e1a
fixing missing
north3221 6cfac23
fixing missing
north3221 41f2af7
fixing missing
north3221 9004983
fixing missing
north3221 859b487
fixing missing
north3221 47a237f
fixing typo
north3221 d54ef9a
fixing typo
north3221 be58a97
fixing missing
north3221 cbfa984
Merge branch 'lanwin:main' into custom_binary_sensor
north3221 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,21 @@ namespace esphome | |
if (dev != nullptr) | ||
dev->update_custom_sensor(message_number, value); | ||
} | ||
|
||
optional<std::set<uint16_t>> /*MessageTarget::*/ get_custom_binary_sensors(const std::string address) override | ||
{ | ||
Samsung_AC_Device *dev = find_device(address); | ||
if (dev != nullptr) | ||
return optional<std::set<uint16_t>>(dev->get_custom_binary_sensors()); | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Can you please check the indentation here. |
||
{ | ||
Samsung_AC_Device *dev = find_device(address); | ||
if (dev != nullptr) | ||
dev->update_custom_binary_sensor(message_number, value); | ||
} | ||
|
||
protected: | ||
Samsung_AC_Device *find_device(const std::string address) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.