-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Introduced a new device class "plug" for the binary sensor. #558
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
Conversation
src/util/hass-util.html
Outdated
@@ -26,7 +26,7 @@ | |||
window.hassUtil.DOMAINS_WITH_MORE_INFO = [ | |||
'alarm_control_panel', 'automation', 'camera', 'climate', 'configurator', | |||
'cover', 'fan', 'group', 'history_graph', 'light', 'lock', 'media_player', 'script', | |||
'sun', 'updater', 'vacuum', 'input_datetime', | |||
'sun', 'updater', 'vacuum', 'input_datetime', 'plug', |
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.
'plug'
is not a home assistant domain.
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.
Thanks, I removed it from there.
You will also need to update the following module and make a PR to the backend repo. |
@MartinHjelmare Thanks for the hint. |
Good! A frontend developer will need to make a proper review here, so stay tuned. |
@@ -385,6 +385,8 @@ | |||
case 'safety': | |||
case 'smoke': | |||
return activated ? 'mdi:verified' : 'mdi:alert'; | |||
case 'plug': | |||
return activated ? 'mdi:power-plug-off' : 'mdi:power-plug'; |
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.
This is reverse. When it is activated it should show plugged.
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.
This whole function has a reversed name:
var activated = state.state && state.state === 'off';
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.
that's weird
Based on #550 this is my suggestion for a new binary sensor device class.
I will use it to monitor the state of pluged/unplugged sonoff switches but it could be used for other wireless switchable sockets.