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 ESPHome native API discovery #19399

Merged
merged 6 commits into from
Jan 5, 2019

Conversation

OttoWinter
Copy link
Member

Description:

Waiting for home-assistant-libs/netdisco#229 and new netdisco release

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.

@ghost ghost assigned OttoWinter Dec 17, 2018
@ghost ghost added the in progress label Dec 17, 2018
@balloob balloob changed the title Add ESPHome native API discovery WIP: Add ESPHome native API discovery Dec 17, 2018
@OttoWinter
Copy link
Member Author

OttoWinter commented Jan 3, 2019

So the 0.85.0 release cutoff is waiting... What's the status on a netdisco release 😜 I was hoping to advertise this new release together with automatic discovery, but it's not a deal-breaker if it's not there just yet either.

(If needed, I can also do the release now that I know more about pypi)

@balloob balloob added this to the 0.85.0 milestone Jan 4, 2019
@@ -21,6 +21,7 @@
from homeassistant.helpers.discovery import async_load_platform, async_discover
import homeassistant.util.dt as dt_util

# TODO: Update netdisco
Copy link
Member

Choose a reason for hiding this comment

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

Released 2.3.0. Bump it in this PR and I'll cherry pick it into the beta.

@OttoWinter OttoWinter changed the title WIP: Add ESPHome native API discovery Add ESPHome native API discovery Jan 5, 2019
@OttoWinter OttoWinter merged commit 6872373 into home-assistant:dev Jan 5, 2019
@ghost ghost removed the in progress label Jan 5, 2019
@OttoWinter OttoWinter deleted the esphome-discovery branch January 5, 2019 15:00
@balloob
Copy link
Member

balloob commented Jan 9, 2019

This PR did not cleanly apply to the rc branch.

Here is the beginning of the diff

diff --cc tests/components/esphome/test_config_flow.py
index d90db501a,1291aa531..000000000
--- a/tests/components/esphome/test_config_flow.py
+++ b/tests/components/esphome/test_config_flow.py
@@@ -193,28 -188,62 +193,90 @@@ async def test_user_invalid_password(ha
      }


++<<<<<<< HEAD
 +async def test_user_login_connection_error(hass, mock_api_connection_error,
 +                                           mock_client):
 +    """Test user step with connection error during login phase."""
 +    flow = config_flow.EsphomeFlowHandler()
 +    flow.hass = hass
 +    await flow.async_step_user(user_input=None)
 +
 +    mock_client.device_info.return_value = mock_coro(
 +        MockDeviceInfo(True, "test"))
 +
 +    await flow.async_step_user(user_input={
 +        'host': '127.0.0.1',
 +        'port': 6053,
 +    })
 +
 +    mock_client.connect.side_effect = mock_api_connection_error
 +    result = await flow.async_step_authenticate(user_input={
 +        'password': 'invalid'
 +    })
 +
 +    assert result['type'] == 'form'
 +    assert result['step_id'] == 'authenticate'
 +    assert result['errors'] == {
 +        'base': 'connection_error'
 +    }
++=======
+ async def test_discovery_initiation(hass, mock_client):
+     """Test discovery importing works."""
+     flow = config_flow.EsphomeFlowHandler()
+     flow.hass = hass
+     service_info = {
+         'host': '192.168.43.183',
+         'port': 6053,
+         'hostname': 'test8266.local.',
+         'properties': {}
+     }

I resolved it by keeping both pieces of code.

balloob pushed a commit that referenced this pull request Jan 9, 2019
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt
@balloob balloob mentioned this pull request Jan 10, 2019
rymsha pushed a commit to rymsha/home-assistant that referenced this pull request Jan 12, 2019
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt
rymsha pushed a commit to rymsha/home-assistant that referenced this pull request Jan 12, 2019
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Feb 12, 2019
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants