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
Broadlink remote #26528
Broadlink remote #26528
Conversation
Sync the fork to the original repository
Sync the fork to the original repository
Please, update the documentation and open a PR for it (be sure to create a documentation PR against the 🏷 I am adding the |
Done. |
It is not clear to me how to combine sending several commands and repeating some commands at the same time. |
|
||
async def async_turn_on(self, **kwargs): | ||
"""Turn the remote on.""" | ||
self._state = True |
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.
What's this. I guess this remote has no state ? In that case let's not fake it but instead just return None
from the state
property.
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 find the state a useful way to disable the remote when needed. Sometimes I need to adjust the controls on the frontend without sending codes (to sync something like a device state or volume level) and having a disable button makes it a lot easier. It's a matter of usability, which can be redesigned if you wish.
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 looks great. Some updates needed but off to a good start. This will be a great improvement!
Since this is a significant change for the broadlink integration, please add yourself to the manifest as a code owner 👍
You could definetely do both. - service: remote.send_command
data:
entity_id: remote.bedroom
device: some_device
command:
- 1
- 2
- 3
num_repeats: 2 The num_repeats is the outer loop, so this script it will send 1 2 3 1 2 3. |
I will start working on the improvements now and respond to other comments as their requirements are completed. |
How to send 1 2 2 2 ? |
@a005 that is an issue for the remote integration, not for the broadlink implementation. |
Very nice! 🎉 |
Description:
This PR introduces a new platform for controlling Broadlink remotes. I know, we already have the Broadlink switch platform that does pretty much the same. But I consider this an enhancement to the wonderful work started by mjg59 and Danielhiversen.
This integration introduces the following improvements:
As a result, learning and command-sending services no longer need to be registered by the Broadlink component as they are already registered by the remote component.
The user no longer needs to learn one command at a time, check the persistent notification and then enter it manually into the configuration file as a switch. He can now use the following service:
This service allows the user to learn a sequence of commands very quickly. All the commands are stored in a JSON file and are easily retrieved by the command sending service. It also allows the user to capture toggle commands by using the 'alternative' flag:
When calling the command learning service with this flag, two codes will be captured for the same command, and will be sent alternatively each time the command is called.
Now the user can send several commands sequentially, and can repeat the sequence as many times as desired. Suppose the user wants to turn on the air conditioner and then turn off the annoying display light with a single service call. He can do something like this:
Now suppose the user wants to increase the volume of the television by 20. He can do something like this:
I use this powerful tool combined with a data template to voice control the volume of my TV. I can say things like "Alexa, set TV volume to 50". If you want to know how I do it, just ask me and I send you the config.
So that's it, I hope you enjoy this integration and make good use of it. And if there is anything I can do to make this code better before it is merged please let me know and I will do it.
Related issue (if applicable): #23888
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10329
Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.