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 long click at new Aqara Wireless Remote Switch #19518

Merged
merged 2 commits into from Dec 22, 2018

Conversation

Projects
None yet
3 participants
@ppanagiotis
Copy link
Contributor

ppanagiotis commented Dec 22, 2018

New Aqara Wireless Remote Switch Single supports long click.
Return click_type = 'long' instead of False

Description:

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

  trigger:
    - platform: event
      event_type: click
      event_data:
        entity_id: binary_sensor.wall_switch_xxxxx
        click_type: long

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

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

Add long click at new Aqara Wireless Remote Switch
New Aqara Wireless Remote Switch Single supports long click.
Return click_type = 'long' instead of False
@homeassistant

This comment has been minimized.

Copy link

homeassistant commented Dec 22, 2018

Hi @ppanagiotis,

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!

@syssi

This comment has been minimized.

Copy link
Member

syssi commented Dec 22, 2018

Thanks for your PR! Could you tell me the model name of the new device?

@ppanagiotis

This comment has been minimized.

Copy link
Contributor

ppanagiotis commented Dec 22, 2018

Thanks for your PR! Could you tell me the model name if the new device?

Sure. b186acn01. Introduced here 315f83e

@syssi
Copy link
Member

syssi left a comment

Should we map long_both_click to long really?

@ppanagiotis

This comment has been minimized.

Copy link
Contributor

ppanagiotis commented Dec 22, 2018

I don't have a new double Aqara Wireless Remote Switch to test the long_both_click.
For now I can rewrite this commit like this if you prefer:

        elif value == 'long_click':
            click_type = 'long'
        elif value == 'long_both_click':
            return False
@syssi

This comment has been minimized.

Copy link
Member

syssi commented Dec 22, 2018

I don't know anymore why the events was filtered for the first generation devices in the past. I will try to understand the implication of your change. Please give me some days for testing.

@ppanagiotis

This comment has been minimized.

Copy link
Contributor

ppanagiotis commented Dec 22, 2018

I don't know anymore why the events was filtered for the first generation devices in the past. I will try to understand the implication of your change. Please give me some days for testing.

Sure.

Just fyi:
I have first generation single and double Aqara wireless switches. First generation switches only support single click (the single one) and single/both_click (the double one). With the current commit applied works just fine.

But I think I should filter out the long_both_click event and keep only long_click.

Thanks for your time.

@syssi

This comment has been minimized.

Copy link
Member

syssi commented Dec 22, 2018

Perfect! Please update your PR. I will approve it afterwards.

@ppanagiotis

This comment has been minimized.

Copy link
Contributor

ppanagiotis commented Dec 22, 2018

Done!

@syssi

This comment has been minimized.

Copy link
Member

syssi commented Dec 22, 2018

Last thing: Coud you extend the Dokumentation? The table of the binary sensor page. Add the device plus the events.

@syssi

syssi approved these changes Dec 22, 2018

@syssi syssi merged commit 07b6aae into home-assistant:dev Dec 22, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.039%
Details

@wafflebot wafflebot bot removed the in progress label Dec 22, 2018

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

Add long click at new Aqara Wireless Remote Switch (home-assistant#19518
)

New Aqara Wireless Remote Switch Single supports long click.

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment