-
Notifications
You must be signed in to change notification settings - Fork 696
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
Fix Sinope device triggers #3504
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_ON, | ||
VALUE: ButtonAction.Pressed_on, | ||
VALUE: int(ButtonAction.Pressed_on), | ||
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. Good catch, sorry about it. I personally prefer Another fix would be to change to 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. So do I :) Problem is that when I tested using |
||
}, | ||
}, | ||
(SHORT_PRESS, TURN_OFF): { | ||
|
@@ -63,7 +63,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_OFF, | ||
VALUE: ButtonAction.Pressed_off, | ||
VALUE: int(ButtonAction.Pressed_off), | ||
}, | ||
}, | ||
(SHORT_RELEASE, TURN_ON): { | ||
|
@@ -74,7 +74,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_ON, | ||
VALUE: ButtonAction.Released_on, | ||
VALUE: int(ButtonAction.Released_on), | ||
}, | ||
}, | ||
(SHORT_RELEASE, TURN_OFF): { | ||
|
@@ -85,7 +85,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_OFF, | ||
VALUE: ButtonAction.Released_off, | ||
VALUE: int(ButtonAction.Released_off), | ||
}, | ||
}, | ||
(DOUBLE_PRESS, TURN_ON): { | ||
|
@@ -96,7 +96,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_ON, | ||
VALUE: ButtonAction.Double_on, | ||
VALUE: int(ButtonAction.Double_on), | ||
}, | ||
}, | ||
(DOUBLE_PRESS, TURN_OFF): { | ||
|
@@ -107,7 +107,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_OFF, | ||
VALUE: ButtonAction.Double_off, | ||
VALUE: int(ButtonAction.Double_off), | ||
}, | ||
}, | ||
(LONG_PRESS, TURN_ON): { | ||
|
@@ -118,7 +118,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_ON, | ||
VALUE: ButtonAction.Long_on, | ||
VALUE: int(ButtonAction.Long_on), | ||
}, | ||
}, | ||
(LONG_PRESS, TURN_OFF): { | ||
|
@@ -129,7 +129,7 @@ class ButtonAction(t.enum8): | |
ATTRIBUTE_ID: 84, | ||
ATTRIBUTE_NAME: ATTRIBUTE_ACTION, | ||
BUTTON: TURN_OFF, | ||
VALUE: ButtonAction.Long_off, | ||
VALUE: int(ButtonAction.Long_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.
I'm OK with this test, but like I said in the other comment, I don't think it's forced anywhere that the value field is an int. I personally think zha should fix rules like this tho (so we don't have to do it in the sinope test, but all fields would be tested at once)
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 agree in principal, and would happily participate in a discussion with the ZHA maintainers, but since there are no guarantees, I'd prefer to patch things in a simple way and have our automations work like before.
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 true, but it's indirectly forced by the fact that Voluptuous fails to handle user types. I did find the root of the problem, described in my comment here: #3504 (comment)