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

Websocket call for rendering jinja2 templates subscription #25614

Merged

Conversation

@thomasloven
Copy link
Contributor

commented Jul 31, 2019

Description:

Add a websocket command for rendering jinja2 templates. Subscribing to this will send a message with the rendered template whenever it needs updating.

Will be used for the markdown-card in lovelace.
Marked WIP until this is done and tested.

I have used an event_message to return the rendered template. Perhaps it should be a new message type instead (maybe even defined in commands.py, like the pong message)?

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

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.
  • I have followed the development checklist

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

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@thomasloven thomasloven requested a review from home-assistant/core as a code owner Jul 31, 2019

@ghost

This comment has been minimized.

Copy link

commented Jul 31, 2019

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (websocket_api) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

@project-bot project-bot bot added this to Needs review in Dev Jul 31, 2019

@thomasloven thomasloven force-pushed the thomasloven:render-template-websocket-command branch 2 times, most recently from da52534 to c6d861a Jul 31, 2019

@thomasloven thomasloven referenced this pull request Aug 1, 2019
@thomasloven

This comment has been minimized.

Copy link
Contributor Author

commented Aug 1, 2019

@thomasloven thomasloven force-pushed the thomasloven:render-template-websocket-command branch from c6d861a to c163c10 Aug 1, 2019

@thomasloven thomasloven force-pushed the thomasloven:render-template-websocket-command branch from c163c10 to c4a2d81 Aug 1, 2019

@thomasloven

This comment has been minimized.

Copy link
Contributor Author

commented Aug 2, 2019

I took the opportunity to also add variables for the templates, because who knows what happens...

@balloob balloob changed the title WIP: Websocket call for rendering jinja2 templates Websocket call for rendering jinja2 templates Aug 6, 2019

@balloob balloob changed the title Websocket call for rendering jinja2 templates Websocket call for rendering jinja2 templates subscription Aug 6, 2019

@balloob
Copy link
Member

left a comment

See comments.

Dev automation moved this from Needs review to Review in progress Aug 6, 2019

@thomasloven thomasloven force-pushed the thomasloven:render-template-websocket-command branch 2 times, most recently from eb22640 to c802571 Aug 7, 2019

@thomasloven thomasloven force-pushed the thomasloven:render-template-websocket-command branch from c802571 to 56033ed Aug 7, 2019

@thomasloven thomasloven force-pushed the thomasloven:render-template-websocket-command branch from fefe8f6 to dc697d0 Aug 7, 2019

Dev automation moved this from Review in progress to Reviewer approved Aug 10, 2019

@balloob balloob merged commit e7e083c into home-assistant:dev Aug 10, 2019

11 checks passed

CI Build #20190810.44 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 100% of diff hit (target 93.98%)
Details
codecov/project 94.04% (target 90%)
Details

Dev automation moved this from Reviewer approved to Done Aug 10, 2019

@lock lock bot locked and limited conversation to collaborators Aug 11, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
3 participants
You can’t perform that action at this time.