Skip to content

Commit

Permalink
Fix code formatting and merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
CM000n committed Jan 3, 2022
1 parent 6c21a04 commit c432528
Show file tree
Hide file tree
Showing 34 changed files with 258 additions and 241 deletions.
19 changes: 10 additions & 9 deletions .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
default_config:

frontend:
themes: !include_dir_merge_named themes
themes: !include_dir_merge_named "themes"

# For some reason default_config is not picking it up.
automation ui: !include automations.yaml
automation ui: !include "automations.yaml"

# lovelace:
# mode: storage
# mode: "storage"

# sensor:
# - platform: time_date
# - platform: "time_date"

logger:
default: info
default: "info"
logs:
custom_components.lovelace_minimalist_ui: debug
custom_components.lovelace_minimalist_ui: "debug"
# If you need to debug uncommment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
# debugpy:

Expand All @@ -28,19 +29,19 @@ logger:
# # Install virtual integration with hacs
# virtual:
# light:
# - platform: virtual
# - platform: "virtual"
# name: "Light 1"
# support_color: true
# support_color_temp: true
# support_white_value: true

# - platform: virtual
# - platform: "virtual"
# name: "Light 2"
# support_color: true
# support_color_temp: true
# support_white_value: true

# - platform: virtual
# - platform: "virtual"
# name: "Light 3"
# support_color: true
# support_color_temp: true
Expand Down
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"image": "ghcr.io/ludeeus/devcontainer/integration:latest",
"name": "Lovelace Minimalist UI integration development",
"context": "..",
"appPort": [
"9123:8123"
],
// "postCreateCommand": "pip install -r requirements_dev.txt",
"postCreateCommand": "container install",
"extensions": [
"ms-python.python",
Expand Down Expand Up @@ -53,4 +51,4 @@
"!include_dir_merge_named scalar"
]
}
}
}
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto eol=lf
* text=auto eol=lf
124 changes: 60 additions & 64 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,62 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository labels will be automatically configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: breaking
description: Breaking Changes
color: bfd4f2
- name: bug
description: Something isn't working
color: d73a4a
- name: build
description: Build System and Dependencies
color: bfdadc
- name: ci
description: Continuous Integration
color: 4a97d6
- name: dependencies
description: Pull requests that update a dependency file
color: 0366d6
- name: documentation
description: Improvements or additions to documentation
color: 0075ca
- name: duplicate
description: This issue or pull request already exists
color: cfd3d7
- name: enhancement
description: New feature or request
color: a2eeef
- name: github_actions
description: Pull requests that update Github_actions code
color: "000000"
- name: good first issue
description: Good for newcomers
color: 7057ff
- name: help wanted
description: Extra attention is needed
color: 008672
- name: invalid
description: This doesn't seem right
color: e4e669
- name: performance
description: Performance
color: "016175"
- name: python
description: Pull requests that update Python code
color: 2b67c6
- name: question
description: Further information is requested
color: d876e3
- name: refactoring
description: Refactoring
color: ef67c4
- name: removal
description: Removals and Deprecations
color: 9ae7ea
- name: style
description: Style
color: c120e5
- name: testing
description: Testing
color: b1fc6f
- name: wontfix
description: This will not be worked on
color: ffffff
- name: ":bell: automerge"
color: "8f4fbc"
description: ""
- name: ":robot: bot"
color: "69cde9"
description: ""
- name: ":bug: bug"
color: "b60205"
description: ""
- name: ":game_die: dependencies"
color: "0366d6"
description: ""
- name: ":memo: documentation"
color: "c5def5"
description: ""
- name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
- name: ":sparkles: enhancement"
color: "0054ca"
description: ""
- name: ":bulb: feature request"
color: "0e8a16"
description: ""
- name: ":mega: feedback"
color: "03a9f4"
description: ""
- name: ":rocket: future maybe"
color: "fef2c0"
description: ""
- name: ":hatching_chick: good first issue"
color: "7057ff"
description: ""
- name: ":pray: help wanted"
color: "4caf50"
description: ""
- name: ":no_entry_sign: invalid"
color: "e6e6e6"
description: ""
- name: ":mag: investigate"
color: "e6625b"
description: ""
- name: ":thinking: needs more info"
color: "795548"
description: ""
- name: ":pushpin: pinned"
color: "28008e"
description: ""
- name: ":question: question"
color: "3f51b5"
description: ""
- name: ":skull: stale"
color: "237da0"
description: ""
- name: ":eyes: upstream"
color: "fbca04"
description: ""
- name: ":coffin: wontfix"
color: "ffffff"
description: ""
23 changes: 10 additions & 13 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: Manage labels
---
name: "Manage labels"

on:
push:
branches:
- main
- master
- dev
branches: ["main", "dev"]

jobs:
labeler:
name: Labeler
runs-on: ubuntu-latest
name: "Labeler"
runs-on: "ubuntu-latest"
steps:
- name: Check out the repository
uses: actions/[email protected]

- name: Run Labeler
uses: crazy-max/[email protected]
- name: "⤵️ Check out code from GitHub"
uses: "actions/checkout@v2"
- name: "\U0001F680 Run Labeler"
uses: "crazy-max/[email protected]"
with:
skip-delete: true
skip-delete: true
3 changes: 0 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// Example of attaching to local debug server
"name": "Python: Attach Local",
"type": "python",
"request": "attach",
Expand All @@ -17,7 +15,6 @@
]
},
{
// Example of attaching to my production server
"name": "Python: Attach Remote",
"type": "python",
"request": "attach",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"*.yaml": "yaml",
"*.yml": "yaml"
}
}
}
19 changes: 11 additions & 8 deletions custom_components/lovelace_minimalist_ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
from __future__ import annotations

import logging

from typing import Any

from homeassistant.core import HomeAssistant
from homeassistant.core import Config
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.components import frontend
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.core import Config, HomeAssistant

from custom_components.lovelace_minimalist_ui.enums import ConfigurationType

from .base import LmuBase
from .const import DOMAIN, NAME, STARTUP_MESSAGE
from .const import DOMAIN, NAME
from .load_dashboard import load_dashboard
from .load_plugins import load_plugins
from .process_yaml import process_yaml
Expand Down Expand Up @@ -45,7 +43,9 @@ async def async_initialize_integration(
if config_entry is not None:
if config_entry.source == SOURCE_IMPORT:
# not sure about this one
hass.async_create_task(hass.config_entries.async_remove(config_entry.entry_id))
hass.async_create_task(
hass.config_entries.async_remove(config_entry.entry_id)
)
return False

lmu.configuration.update_from_dict(
Expand All @@ -66,6 +66,7 @@ async def async_initialize_integration(

return True


async def async_setup(hass: HomeAssistant, config: Config):
"""Set up this integration using UI."""
return await async_initialize_integration(hass=hass, config=config)
Expand All @@ -74,6 +75,7 @@ async def async_setup(hass: HomeAssistant, config: Config):

# return True


async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up this integration using UI."""

Expand All @@ -85,12 +87,13 @@ async def async_remove_entry(hass: HomeAssistant, config_entry: ConfigEntry):
"""Remove Integration"""
_LOGGER.debug("{} is now uninstalled".format(NAME))

#TODO cleanup:
# TODO cleanup:
# - themes
# - blueprints
frontend.async_remove_panel(hass, "lovelace-minimalist-ui")


async def async_reload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
_LOGGER.debug('Reload the config entry')
_LOGGER.debug("Reload the config entry")

await async_setup_entry(hass, config_entry)
13 changes: 4 additions & 9 deletions custom_components/lovelace_minimalist_ui/base.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
"""Base Lovelace Minimalist UI class."""
from __future__ import annotations

import asyncio
from dataclasses import asdict, dataclass, field
from typing import Any

from .const import (
DEFAULT_SIDEPANEL_ICON,
DEFAULT_SIDEPANEL_TITLE,
DEFAULT_INCLUDE_OTHER_CARDS,
DEFAULT_LANGUAGE,
DEFAULT_SIDEPANEL_ICON,
DEFAULT_SIDEPANEL_TITLE,
DEFAULT_THEME,
DEFAULT_THEME_PATH,
DEFAULT_THEME
)
from .enums import (
ConfigurationType
)
from .enums import ConfigurationType


@dataclass
Expand All @@ -33,8 +30,6 @@ class LmuConfiguration:
include_other_cards: bool = DEFAULT_INCLUDE_OTHER_CARDS
language: str = DEFAULT_LANGUAGE



def to_json(self) -> str:
"""Return a json string."""
return asdict(self)
Expand Down
Loading

0 comments on commit c432528

Please sign in to comment.