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

Support multiple Lovelace dashboards #32134

Merged
merged 5 commits into from
Feb 25, 2020
Merged

Support multiple Lovelace dashboards #32134

merged 5 commits into from
Feb 25, 2020

Conversation

balloob
Copy link
Member

@balloob balloob commented Feb 24, 2020

Breaking change

Proposed change

Support multiple Lovelace dashboards. YAML only for this PR.

To do:

  • Update docs
  • Coordinate with @bramkragten if frontend changes for this are ok.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml
lovelace:
  dashboards:
    bla:
      mode: yaml
      filename: bla.yaml
      sidebar:  # Optional
        title: Make it rain
        icon: mdi:cash-100
    generated:
      mode: yaml
      # Same behavior as with default. If file doesn't exist we generate one.
      filename: notexist.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

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

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link

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

@probot-home-assistant
Copy link

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

@codecov
Copy link

codecov bot commented Feb 24, 2020

Codecov Report

Merging #32134 into dev will increase coverage by 0.02%.
The diff coverage is 94.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #32134      +/-   ##
==========================================
+ Coverage   94.73%   94.75%   +0.02%     
==========================================
  Files         767      772       +5     
  Lines       55505    55857     +352     
==========================================
+ Hits        52580    52928     +348     
- Misses       2925     2929       +4
Impacted Files Coverage Δ
...eassistant/components/websocket_api/permissions.py 100% <100%> (ø) ⬆️
homeassistant/helpers/config_validation.py 96.01% <100%> (ø) ⬆️
homeassistant/helpers/collection.py 95.81% <100%> (+0.22%) ⬆️
homeassistant/components/lovelace/const.py 100% <100%> (ø)
homeassistant/components/lovelace/websocket.py 93.47% <93.47%> (ø)
homeassistant/components/lovelace/dashboard.py 93.75% <93.75%> (ø)
homeassistant/components/lovelace/resources.py 94.11% <94.11%> (ø)
...meassistant/components/mqtt/vacuum/schema_state.py 91.13% <0%> (-0.59%) ⬇️
homeassistant/components/twitch/sensor.py 96.7% <0%> (-0.04%) ⬇️
homeassistant/components/rflink/light.py 100% <0%> (ø) ⬆️
... and 62 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9801810...3824da9. Read the comment docs.

@@ -84,13 +94,23 @@ def __init__(self, hass: HomeAssistant, ll_config: LovelaceConfig):

async def _process_create_data(self, data: dict) -> dict:
"""Validate the config is valid."""
raise NotImplementedError
data = self.CREATE_SCHEMA(data)
data[CONF_TYPE] = data.pop(CONF_TYPE_WS)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not something that the collection should be aware off. We should pop this out before it gets here.

@@ -84,13 +94,23 @@ def __init__(self, hass: HomeAssistant, ll_config: LovelaceConfig):

async def _process_create_data(self, data: dict) -> dict:
"""Validate the config is valid."""
raise NotImplementedError
data = self.CREATE_SCHEMA(data)
data[CONF_TYPE] = data.pop(CONF_TYPE_WS)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not something that the collection should be aware off. We should pop this out before it gets here.

@codecov-io
Copy link

codecov-io commented Feb 25, 2020

Codecov Report

Merging #32134 into dev will increase coverage by 0.02%.
The diff coverage is 94.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #32134      +/-   ##
==========================================
+ Coverage   94.73%   94.75%   +0.02%     
==========================================
  Files         767      772       +5     
  Lines       55505    55861     +356     
==========================================
+ Hits        52580    52930     +350     
- Misses       2925     2931       +6
Impacted Files Coverage Δ
...eassistant/components/websocket_api/permissions.py 100% <100%> (ø) ⬆️
homeassistant/helpers/config_validation.py 96.01% <100%> (ø) ⬆️
homeassistant/helpers/collection.py 95.81% <100%> (+0.22%) ⬆️
homeassistant/components/lovelace/const.py 100% <100%> (ø)
homeassistant/components/lovelace/websocket.py 93.47% <93.47%> (ø)
homeassistant/components/lovelace/dashboard.py 93.75% <93.75%> (ø)
homeassistant/components/lovelace/resources.py 94.11% <94.11%> (ø)
...istant/components/google_assistant/report_state.py 83.33% <0%> (-1.67%) ⬇️
homeassistant/components/alexa/state_report.py 83.63% <0%> (-0.63%) ⬇️
...meassistant/components/mqtt/vacuum/schema_state.py 91.13% <0%> (-0.59%) ⬇️
... and 64 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9801810...3824da9. Read the comment docs.

@balloob balloob merged commit 536b313 into dev Feb 25, 2020
@balloob balloob deleted the lovelace-dashboards branch February 25, 2020 19:18
@lock lock bot locked and limited conversation to collaborators Feb 28, 2020
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.

4 participants