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

Fixed issue 15340. Alexa Smart Home now handles unsupported properties correctly #15352

Merged
merged 1 commit into from
Jul 9, 2018

Conversation

iliketoprogram14
Copy link
Contributor

@iliketoprogram14 iliketoprogram14 commented Jul 7, 2018

Fixed issue 15340. alexa/smart home now properly skips over properties that aren't supported in the current state, eg lowerSetpoint in Heat mode or targetSetpoint in Eco mode for Nest devices.

Description:

As described in issue 15340, the Alexa smart home skill cannot retrieve the properties of a climate device like the Nest (not sure about other devices). When Alexa asks for a state report, alexa/smart_home.py attempts to return all of the properties of the climate component, even if the properties are null. Properties can be null depending on the state of the device. For example, target_temp_low is null if the thermostat mode only has a single setpoint, and target_temperature is null when the mode has two setpoints (lower and upper). So, when Alexa asks for a state report, some property values are always null, causing ThermostatController.get_property() to always fail with the UnsupportedProperty exception.

The fix is to have the only caller, serialize_properties, handle a None return value from get_property, and have get_property return None if the associated value is actually null or None.

Related issue (if applicable): fixes #15340

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

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 - N/A

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

If the code does not interact with devices: N/A

@homeassistant
Copy link
Contributor

Hi @rmiller14,

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!

@homeassistant
Copy link
Contributor

Hi @rmiller14,

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!

@homeassistant
Copy link
Contributor

Hi @rmiller14,

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!

…at aren't supported in the current state, eg lowerSetpoint in Heat mode or targetSetpoint in Eco mode for Nest devices.
@balloob
Copy link
Member

balloob commented Jul 9, 2018

Awesome! 🎉

@balloob balloob merged commit 1d1408b into home-assistant:dev Jul 9, 2018
@ghost ghost removed the in progress label Jul 9, 2018
awarecan pushed a commit to awarecan/home-assistant that referenced this pull request Jul 16, 2018
…at aren't supported in the current state, eg lowerSetpoint in Heat mode or targetSetpoint in Eco mode for Nest devices. (home-assistant#15352)
@balloob balloob mentioned this pull request Jul 20, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 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.

Alexa/Nest UnsupportedProperty lowerSetpoint
3 participants