-
Notifications
You must be signed in to change notification settings - Fork 469
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
Request to add a Zigbee button for SLED switch #1021
Conversation
Add SAMSUNG-ITM-Z-005
SLED profiles for SAMSUNG-ITM-Z-005
Add SLED for SAMSUNG-ITM-Z-005
add SLED for SAMSUNG-ITM-Z-005
add SLED for SAMSUNG-ITM-Z-005
Duplicate profile check: Passed - no duplicate profiles detected. |
Channel deleted. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 8c6fc70 |
@@ -0,0 +1,93 @@ | |||
-- Copyright 2022 SmartThings |
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.
date
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.
I will modify it.
local fields = { | ||
IGNORE_MOVETOCOLORTEMP = "ignore_next_movetocolortemperature" | ||
} |
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.
unused
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.
I will delete it.
local comp = device.profile.components[button_name] | ||
if comp ~= nil then | ||
device:emit_component_event(comp, event) | ||
device:emit_event(event) |
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.
the main component does not have the button capability so this will fail, same below
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.
Do you mean to delete this code?
Or do you want me to add button from main in profile?
-id: main
capabilities:
- id: button
version: 1
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.
Up to you how to implement it. Either of those solutions would work.
In our drivers, we have had the main component of a multi-button device emit an event when any of the buttons are pressed, but some users have found this confusing.
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.
We will also be confused if we have a main component.
Then please guide me on how to modify the code without main component.
If not, I will add main component.
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.
just remove the device:emit_event(event)
line
That attempts to emit the event from the main component, which does not have the capability used by the event, and so it would log a warning.
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.
I will check it after modifying it. Thanks.
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.
I modified the code, but the held button is not visible, so I am rechecking it.
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.
please includes some tests
I'd at least like a test of the "added" and some of the pressed and pushed events just to verify that you're setting supportedButtonValues
correctly.
Hello @seungkwan-choi Please see our review, we look forward to your additional changes and thank you. |
|
add SLED folder
modify code
{ mfr = "Samsung Electronics", model = "SAMSUNG-ITM-Z-005" }, | ||
}, | ||
SUPPORTED_BUTTON_VALUES = { "pushed" }, |
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 why you're not seeing held
events. A supportedButtonValues
event needs to be generated for each button component that has the button capability that lists the supported values. Because you've added your device to this list here, the zigbee-multi-button
driver's init method only emits a supportedButtonValues event with "pushed"
instead of "pushed", "held"
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.
The code has been modified. Please review.
Please also address the |
add push_held_3
end | ||
|
||
local do_configure = function(self, device) | ||
do_refresh(self, device) |
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.
as pointed out by the luacheck automation, do_refresh
is not defined
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.
lua code has been changed.
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.
I'd like to see some tests of this code, please.
Those tests would have made it even more obvious that you were referencing an undefined value.
Delete do_refresh
NAME = "SLED Button", | ||
capability_handlers = { | ||
[capabilities.refresh.ID] = { | ||
[capabilities.refresh.commands.refresh.NAME] = do_refresh, |
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.
you are also referencing do_refresh
here
Checking drivers/SmartThings/zigbee-button/src/zigbee-multi-button/SLED/init.lua 3 warnings
drivers/SmartThings/zigbee-button/src/zigbee-multi-button/SLED/init.lua:30:45: (W612) line contains trailing whitespace
drivers/SmartThings/zigbee-button/src/zigbee-multi-button/SLED/init.lua:44:45: (W612) line contains trailing whitespace
drivers/SmartThings/zigbee-button/src/zigbee-multi-button/SLED/init.lua:59:54: (W113) accessing undefined variable do_refresh
Please address these comments. Please write some tests for this behavior.
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.
The code was modified and there were no errors through lua check.
modify lua file(delete do_refresh)
Change whitespace
@@ -25,6 +25,7 @@ local devices = { | |||
{ mfr = "CentraLite", model = "3450-L" }, | |||
{ mfr = "CentraLite", model = "3450-L2" }, | |||
{ mfr = "ROBB smarrt", model = "ROB_200-008-0" } | |||
|
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 we please remove this extra line that is empty?
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.
Remove the extra line.
end | ||
end | ||
|
||
|
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.
I believe this is extra whitespace as well that needs to be removed, please review.
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.
Remove the extra line
Remove extra line
remove extra line
@@ -24,7 +24,7 @@ local devices = { | |||
MATCHING_MATRIX = { | |||
{ mfr = "CentraLite", model = "3450-L" }, | |||
{ mfr = "CentraLite", model = "3450-L2" }, | |||
{ mfr = "ROBB smarrt", model = "ROB_200-008-0" } | |||
{ mfr = "ROBB smarrt", model = "ROB_200-008-0" } |
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.
{ mfr = "ROBB smarrt", model = "ROB_200-008-0" } | |
{ mfr = "ROBB smarrt", model = "ROB_200-008-0" } |
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.
if you delete and change the whitespace in the code, it will not be saved and it will be shown to request a creat pull request patch.
Please check it.
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.
I'm not sure what you mean.
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.
Remove the whitespace.
@@ -39,7 +39,8 @@ local ZIGBEE_MULTI_BUTTON_FINGERPRINTS = { | |||
{ mfr = "ShinaSystem", model = "SBM300ZB3" }, | |||
{ mfr = "ROBB smarrt", model = "ROB_200-007-0" }, | |||
{ mfr = "ROBB smarrt", model = "ROB_200-008-0" }, | |||
{ mfr = "WALL HERO", model = "ACL-401SCA4" } | |||
{ mfr = "WALL HERO", model = "ACL-401SCA4" }, | |||
{ mfr = "Samsung Electronics", model = "SAMSUNG-ITM-Z-005" }, |
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.
{ mfr = "Samsung Electronics", model = "SAMSUNG-ITM-Z-005" }, | |
{ mfr = "Samsung Electronics", model = "SAMSUNG-ITM-Z-005" } |
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.
if you delete and change the comma in the code, it will not be saved and it will be shown to request a creat pull request patch.
Please check it.
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.
Remove the comma.
delete whitespace
delete comma
This is a new project for Samsung LED.
It's a ZigBee Button and the model no. is SAMSUNG-ITM-Z-005.
Please review it.