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

Projects
None yet
3 participants
@OttoWinter
Copy link
Contributor

OttoWinter commented Dec 17, 2018

Description:

Waiting for home-assistant/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.

@wafflebot wafflebot bot 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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

@balloob

balloob Jan 4, 2019

Member

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

OttoWinter added some commits Dec 17, 2018

@OttoWinter OttoWinter force-pushed the OttoWinter:esphome-discovery branch from cc35e73 to 5e3757b Jan 5, 2019

@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

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 increased (+0.001%) to 93.075%
Details

@wafflebot wafflebot bot removed the in progress label Jan 5, 2019

@OttoWinter OttoWinter deleted the OttoWinter:esphome-discovery branch Jan 5, 2019

@balloob

This comment has been minimized.

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 added a commit that referenced this pull request Jan 9, 2019

Add ESPHome native API discovery (#19399)
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

rymsha added a commit to rymsha/home-assistant that referenced this pull request Jan 12, 2019

Add ESPHome native API discovery (home-assistant#19399)
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt

rymsha added a commit to rymsha/home-assistant that referenced this pull request Jan 12, 2019

Add ESPHome native API discovery (home-assistant#19399)
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

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