-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Allow using more than one keyboard remote #11061
Allow using more than one keyboard remote #11061
Conversation
This sets up one thread per keyboard remote, listening for events.
Hi @BryanJacobs, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
@@ -40,7 +41,15 @@ | |||
vol.Exclusive(DEVICE_DESCRIPTOR, DEVICE_ID_GROUP): cv.string, | |||
vol.Exclusive(DEVICE_NAME, DEVICE_ID_GROUP): cv.string, | |||
vol.Optional(TYPE, default='key_up'): | |||
vol.All(cv.string, vol.Any('key_up', 'key_down', 'key_hold')), | |||
vol.All(cv.string, vol.Any('key_up', 'key_down', 'key_hold')), | |||
vol.Exclusive(DEVICES, DEVICE_ID_GROUP): vol.All(cv.ensure_list, [ |
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.
Instead of adding ensure_list
here, you can just wrap the whole DOMAIN config as an ensure list. No need to specify the schema twice.
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 have done so. Be aware this means you can never backwards-compatibly add module-level (not keyboard-level) configuration options in the future.
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.
Instead of adding a new devices
key, just wrap the whole config in an ensure list, that way you are backwards compatible and support multiple keyboards.
}), | ||
DOMAIN: | ||
vol.All(cv.ensure_list, [ | ||
vol.Exclusive(DEVICE_DESCRIPTOR, DEVICE_ID_GROUP): cv.string, |
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.
SyntaxError: invalid syntax
e67e396
to
1d6bef4
Compare
not config.get(DEVICE_NAME): | ||
_LOGGER.error("No device_descriptor or device_name found") | ||
not config.get(DEVICE_NAME) and\ | ||
not config.get(DEVICES): |
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.
undefined name 'DEVICES'
…into dev * 'dev' of https://github.com/home-assistant/home-assistant: Disable html5 notify dependency (home-assistant#11135) ISY994 sensor improvements (home-assistant#10805) Allow using more than one keyboard remote (home-assistant#11061) set default utc offset to 0 (home-assistant#11114) Add problem device class (home-assistant#11130) Always consume the no_throttle keyword argument. (home-assistant#11126) Skip HASS emulated Hue bridges from detection. (home-assistant#11128) update pyripple (home-assistant#11122) Add media position properties (home-assistant#10076) Fixed typo in automation.py (home-assistant#11116)
Description:
This sets up one thread per keyboard remote, listening for events.
Various "air mouse" devices expose more than one evdev device. To use buttons that manifest as keyboard keys and buttons that manifest as multimedia keys on the same instance of home-assistant, it's necessary to set up more than one event listener.
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
Documentation added/updated in home-assistant.github.io
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests passNo tests have been added, as this component appears to be untested already.