Skip to content

Adds support for switch properties in device_state_attributes#13816

Closed
markperdue wants to merge 1 commit intohome-assistant:devfrom
markperdue:dev
Closed

Adds support for switch properties in device_state_attributes#13816
markperdue wants to merge 1 commit intohome-assistant:devfrom
markperdue:dev

Conversation

@markperdue
Copy link
Copy Markdown
Contributor

Description:

  • Adds support for returning additional attributes exposed by the pyvesync library via the device_state_attributes property

Related issue (if applicable): fixes #

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

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.

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Apr 12, 2018

@balloob connection state is okay but the other will be to static?

@markperdue
Copy link
Copy Markdown
Contributor Author

markperdue commented Apr 12, 2018

@pvizeli the connection_status is likely to be the only one that changes during use of HASS for this pr. The other properties would generally be static (but they could be updated depending on what the vesync api returns) and return information on the device for other automations to iterate over/parse as needed

I added some info to the docs at https://www.home-assistant.io/components/switch.vesync/ that describe the attributes in case it helps

@balloob
Copy link
Copy Markdown
Member

balloob commented Apr 14, 2018

We should not include any model info or other static info. Connection status should also not be part of the attributes but instead be represented as the available property.

Note that I also have a vesync PR open because it was doing I/O inside the event loop. Did you never see any warnings related to vesync in your logs? 🤔 #13862

@markperdue
Copy link
Copy Markdown
Contributor Author

@balloob Got it. The component is already using the available property so I will close out this PR since it would only be including mostly static details then.

I did not see any warning related to I/O in the hass logs so I thought I was in the clear but nice catch with that. I am running hass in a docker container so I'll investigate around a bit to see how I can add verbosity to the logs to catch that condition. Thanks

@markperdue markperdue closed this Apr 19, 2018
markperdue added a commit to markperdue/home-assistant.github.io that referenced this pull request Apr 19, 2018
The PR home-assistant/core#13816 has been withdrawn since it exposed static attributes which are not supported. Updating wiki to reflect current state
fabaff pushed a commit to home-assistant/home-assistant.io that referenced this pull request Apr 20, 2018
The PR home-assistant/core#13816 has been withdrawn since it exposed static attributes which are not supported. Updating wiki to reflect current state
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 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