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

Custom panel #14708

Merged
merged 6 commits into from Jun 1, 2018

Conversation

Projects
None yet
3 participants
@balloob
Member

balloob commented May 30, 2018

Description:

Add three new options to custom panel:

  • embed_iframe: this will render the custom panel in an iframe. This is needed if your panel has conflicting custom elements or if you're using React (because it's not ShadowDOM compatible)
  • js_url: this will load the custom panel from a URL.
  • trust_external_script: if set to false, frontend will ask user to confirm before loading the script

Depends on frontend PR: home-assistant/home-assistant-polymer#1236

Example entry for configuration.yaml (if applicable):

# Configuration.yaml example
panel_custom:
  - name: react-panel
    url_path: react-panel-prod
    sidebar_title: React Prod
    sidebar_icon: mdi:react
    js_url: https://s3.amazonaws.com/home-assistant-demos/panel-examples/react-demo.js
    embed_iframe: true
    config:
      name: World

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

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

@balloob balloob requested a review from home-assistant/core as a code owner May 30, 2018

if CONF_JS_URL in panel:
config['js_url'] = panel[CONF_JS_URL]
elif not os.path.isfile(panel_path):

This comment has been minimized.

@MartinHjelmare

MartinHjelmare May 31, 2018

Member

This does I/O.

@balloob

This comment has been minimized.

Member

balloob commented May 31, 2018

fixed.

balloob added some commits May 27, 2018

@balloob balloob removed the breaking change label Jun 1, 2018

@balloob balloob force-pushed the custom-panel branch from ed8978d to 2056651 Jun 1, 2018

@balloob balloob merged commit f6eb9e7 into dev Jun 1, 2018

5 of 6 checks passed

coverage/coveralls Coverage decreased (-0.4%) to 93.589%
Details
Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@balloob balloob deleted the custom-panel branch Jun 1, 2018

PhilRW added a commit to PhilRW/home-assistant that referenced this pull request Jun 1, 2018

Custom panel (home-assistant#14708)
* Add support for custom panels in JS

* Allow specifying JS custom panels

* Add trust external option

* Fix tests

* Do I/O outside event loop

* Change config to avoid breaking change

@balloob balloob referenced this pull request Jun 8, 2018

Merged

0.71.0 #14876

cyberjacob pushed a commit to cyberjacob/home-assistant that referenced this pull request Sep 4, 2018

Custom panel (home-assistant#14708)
* Add support for custom panels in JS

* Allow specifying JS custom panels

* Add trust external option

* Fix tests

* Do I/O outside event loop

* Change config to avoid breaking change

@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.