Skip to content

Expose Alexa Smart Home via HTTP POST#11859

Merged
balloob merged 2 commits into
home-assistant:devfrom
bitglue:smart_home
Jan 23, 2018
Merged

Expose Alexa Smart Home via HTTP POST#11859
balloob merged 2 commits into
home-assistant:devfrom
bitglue:smart_home

Conversation

@bitglue
Copy link
Copy Markdown
Member

@bitglue bitglue commented Jan 22, 2018

Description:

Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.

Related issue: auchter/haaska#102

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#4493

Example entry for configuration.yaml (if applicable):

See documentation PR: home-assistant/home-assistant.io#4493

Checklist:

  • The code change is tested and works locally.

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

  • Documentation added/updated

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @bitglue,

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!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)

bitglue added a commit to bitglue/haaska that referenced this pull request Jan 22, 2018
Haaska was using the v2 payload, which is now deprecated. Fortunately,
home-assistant implemented the v3 payload.
home-assistant/core#11859 exposes this
via an HTTP POST, which allows Haaska's Lambda function to be simplified
to some trivial glue.
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.

Instead of vol.Any, just mark the key as vol.Optional (like this)

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.

You probably have to wrap the containing dictionary in a vol.Schema: DOMAIN: vol.Schema({

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.

Oh I guess you still need to use Any with None since the presence of the key indicates setting up the smart home view.

Nevermind this comment.

@balloob
Copy link
Copy Markdown
Member

balloob commented Jan 23, 2018

Awesome! 👍

I was expecting this PR 😉

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

A few minor changes needed.

@balloob
Copy link
Copy Markdown
Member

balloob commented Jan 23, 2018

One more thing, please add a quick test to make sure the http frontend works

Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
@bitglue
Copy link
Copy Markdown
Member Author

bitglue commented Jan 23, 2018

@balloob Done. Changes were simple enough I just squashed them. Hope that's OK.

Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
@bitglue
Copy link
Copy Markdown
Member Author

bitglue commented Jan 23, 2018

Not sure what's up with Travis. Seems unrelated to my changes?

@balloob
Copy link
Copy Markdown
Member

balloob commented Jan 23, 2018

Travis choked on a flaky test. That's fine.

Great work!

@balloob balloob merged commit 990e076 into home-assistant:dev Jan 23, 2018
@wladwnt
Copy link
Copy Markdown

wladwnt commented Jan 25, 2018

@bitglue: Thank you very much for this PR! May I ask you to add Alexa.TemperatureSensor and Alexa.ThermostatController features?

@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Jan 25, 2018

Please use our forum for feature requests. This PR is merged.

https://community.home-assistant.io/c/feature-requests

@home-assistant home-assistant locked and limited conversation to collaborators Jan 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants