Skip to content
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

Add support for learning RF commands with Broadlink remotes #39671

Merged
merged 4 commits into from
Nov 12, 2020

Conversation

felipediel
Copy link
Contributor

@felipediel felipediel commented Sep 5, 2020

Proposed change

This PR adds support for learning RF commands with Broadlink devices. These are the proposed changes:

  • Create a method for learning RF commands. This method will be called when the user specifies command_type: rf in remote.learn_command service.
  • The method for learning IR commands remains as a default option. The user can also make it explicit by calling remote.learn_command with command_type: ir.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml
script:
  learn_car_lock:
    sequence:
      - service: remote.learn_command
        data:
          entity_id: remote.garage
          device: car
          command: unlock
          command_type: rf

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @Danielhiversen, mind taking a look at this pull request as its been labeled with an integration (broadlink) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@stale
Copy link

stale bot commented Oct 12, 2020

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale label Oct 12, 2020
@stale stale bot removed the stale label Oct 12, 2020
@felipediel felipediel marked this pull request as draft October 12, 2020 02:37
@felipediel felipediel marked this pull request as ready for review November 3, 2020 20:11
Copy link
Contributor

@elupus elupus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks alright

homeassistant/components/broadlink/remote.py Outdated Show resolved Hide resolved
Dev automation moved this from By Code Owner to Reviewer approved Nov 7, 2020
Copy link
Member

@springstan springstan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small comments ✌️

homeassistant/components/broadlink/remote.py Outdated Show resolved Hide resolved
homeassistant/components/broadlink/remote.py Outdated Show resolved Hide resolved
homeassistant/components/broadlink/remote.py Outdated Show resolved Hide resolved
homeassistant/components/broadlink/remote.py Outdated Show resolved Hide resolved
@felipediel
Copy link
Contributor Author

It's better now. Thanks, guys.

Copy link
Member

@springstan springstan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@springstan springstan merged commit c620fa3 into home-assistant:dev Nov 12, 2020
Dev automation moved this from Reviewer approved to Done Nov 12, 2020
KJonline pushed a commit to Pyhass/core that referenced this pull request Nov 13, 2020
* 'dev' of https://github.com/home-assistant/core: (32 commits)
  Disable parsing scientific/complex number notation in template type (home-assistant#43170)
  Remove relative time sensor from cert_expiry (home-assistant#42338)
  Further improve MFI tests (home-assistant#43167)
  Update translations
  Guard against empty ssdp locations (home-assistant#43156)
  Fix playing of Spotify URIs on Sonos (home-assistant#43154)
  Add missing 'hassio' translation string (home-assistant#43127)
  Streamline SimpliSafe errors (home-assistant#43117)
  Update xknx to 0.15.3 (home-assistant#42026)
  Fix beat calculation (home-assistant#43142)
  Mock time_date sensor tests (home-assistant#43141)
  [ci skip] Translation update
  Fix bug preventing Notion entities from updating their bridge (home-assistant#43122)
  Bump hass-nabucasa to 0.37.2 (home-assistant#43146)
  Shelly: minor improvements (home-assistant#43138)
  Add support for learning RF commands with Broadlink remotes (home-assistant#39671)
  Fix incorrect Notion battery state calculation (home-assistant#43108)
  Bump hatasmota to 0.0.30 (home-assistant#43140)
  Add VSCode debug launch conf (home-assistant#43130)
  Revert "shelly_naming" rebase errors (home-assistant#43134)
  ...
rccoleman pushed a commit to rccoleman/core that referenced this pull request Dec 4, 2020
…istant#39671)

* Add support for learning RF codes with Broadlink remotes

* Rename INFRARED and RADIOFREQUENCY to COMMAND_TYPE_IR and COMMAND_TYPE_RF

* Rewrite if expression as normal if statement

* Use COMMAND_TYPE_IR directly and improve error messages
rccoleman pushed a commit to rccoleman/core that referenced this pull request Dec 4, 2020
…istant#39671)

* Add support for learning RF codes with Broadlink remotes

* Rename INFRARED and RADIOFREQUENCY to COMMAND_TYPE_IR and COMMAND_TYPE_RF

* Rewrite if expression as normal if statement

* Use COMMAND_TYPE_IR directly and improve error messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

Learning doesn't work on Broadlink RM2 Pro Plus_300
5 participants