Skip to content

[WIP] Add more functions to lovelace ws#17702

Closed
bramkragten wants to merge 1 commit intohome-assistant:devfrom
bramkragten:lovelace-ws-cards
Closed

[WIP] Add more functions to lovelace ws#17702
bramkragten wants to merge 1 commit intohome-assistant:devfrom
bramkragten:lovelace-ws-cards

Conversation

@bramkragten
Copy link
Copy Markdown
Member

@bramkragten bramkragten commented Oct 22, 2018

WIP

Description:

Adds more functions to the websocket for lovelace. This should complete the functions for the cards. Next up are the views.

TODO:

Test and add tests

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

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 or updated 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.

WS_TYPE_DELETE_CARD = 'lovelace/config/card/delete'

WS_TYPE_GET_VIEW = 'lovelace/config/view/get'
WS_TYPE_SET_VIEW = 'lovelace/config/view/set'
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.

We should not support this. People can move individual cards but shouldn't be able to do many cards at once.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The idea was that you would get the config of the view, without the cards, and could edit the name and icon, etc. But that was for a different PR, so should not have been in here...

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.

Good point. We should make a update command for view, but it should exclude cards then.


WS_TYPE_GET_CARD = 'lovelace/config/card/get'
WS_TYPE_SET_CARD = 'lovelace/config/card/set'
WS_TYPE_ADD_CARD = 'lovelace/config/card/add'
Copy link
Copy Markdown
Member

@balloob balloob Oct 22, 2018

Choose a reason for hiding this comment

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

Code review would be a lot easier if you either have a single commit per WS command, so it's easy to review. Or if you do a PR per command.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will do, tomorrow night I'll have time to work on it.

WS_TYPE_GET_LOVELACE_UI = 'lovelace/config'

WS_TYPE_GET_CARD = 'lovelace/config/card/get'
WS_TYPE_SET_CARD = 'lovelace/config/card/set'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should we rename set to update, maybe it is clearer?

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.

I like update.

@bramkragten
Copy link
Copy Markdown
Member Author

Closing for #17730

@ghost ghost removed the in progress label Oct 23, 2018
@bramkragten bramkragten deleted the lovelace-ws-cards branch October 26, 2018 13:00
@bramkragten bramkragten restored the lovelace-ws-cards branch October 26, 2018 13:00
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
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.

3 participants