Skip to content

Add support to ignore a xiaomi aqara gateway#14428

Merged
syssi merged 4 commits intohome-assistant:devfrom
kerwin612:dev-for-src
May 19, 2018
Merged

Add support to ignore a xiaomi aqara gateway#14428
syssi merged 4 commits intohome-assistant:devfrom
kerwin612:dev-for-src

Conversation

@kerwin612
Copy link
Copy Markdown
Contributor

@kerwin612 kerwin612 commented May 13, 2018

Description:

Introduces a configuration parameter to ignore a Xiaomi Gateway. Per default all available gateways are discovered and handled by Home Assistant.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

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

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

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@Kane610
Copy link
Copy Markdown
Member

Kane610 commented May 13, 2018

Why would you want to support disabled gateways?

@syssi
Copy link
Copy Markdown
Member

syssi commented May 13, 2018

The auto discovery picks up all available gateways. May be selected ones shouldn't interact with HA.

@syssi
Copy link
Copy Markdown
Member

syssi commented May 13, 2018

The title and description of the PR is misleading.

@kerwin612
Copy link
Copy Markdown
Contributor Author

emmm...yes,,my english is so bad...@syssi thanks for your help

@Kane610
Copy link
Copy Markdown
Member

Kane610 commented May 13, 2018

Wouldn't it be better to use the configurator for this?

@syssi
Copy link
Copy Markdown
Member

syssi commented May 13, 2018

Could you explain this?

@Kane610
Copy link
Copy Markdown
Member

Kane610 commented May 13, 2018

The configurator would allow configuration of each identifies gateway directly in the gui. Then it would just be a check box to disable/ignore

@syssi
Copy link
Copy Markdown
Member

syssi commented May 13, 2018

Do you mean the hassio add-on? In this case the approach here is the right one.

@fabaff fabaff changed the title support disabled gateway Add support to disabled gateway May 13, 2018
@Kane610
Copy link
Copy Markdown
Member

Kane610 commented May 13, 2018

@syssi syssi changed the title Add support to disabled gateway Add support to ignore a gateway May 14, 2018
CONF_GATEWAYS = 'gateways'
CONF_INTERFACE = 'interface'
CONF_KEY = 'key'
CONF_DISABLED = 'disabled'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you rename the setting from "disabled" to "disable"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure

@syssi
Copy link
Copy Markdown
Member

syssi commented May 17, 2018

This PR requires an upcoming release of PyXiaomiGateway.

@syssi
Copy link
Copy Markdown
Member

syssi commented May 17, 2018

I've released PyXiaomiGateway 0.9.4. Please update the requirements of homeassistant/components/xiaomi_aqara.py.

@syssi
Copy link
Copy Markdown
Member

syssi commented May 17, 2018

I've added some docs: home-assistant/home-assistant.io#5388

@MartinHjelmare MartinHjelmare changed the title Add support to ignore a gateway Add support to ignore a xiaomi aqara gateway May 19, 2018
@syssi
Copy link
Copy Markdown
Member

syssi commented May 19, 2018

requirements_all.txt is not up to date
Please run script/gen_requirements_all.py

@syssi
Copy link
Copy Markdown
Member

syssi commented May 19, 2018

Instead calling gen_requirements_all.py you could increment the PyXiaomiGateway version at ./requirements_all.txt.

@syssi syssi merged commit c316d5b into home-assistant:dev May 19, 2018
@balloob balloob mentioned this pull request Jun 8, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants