Skip to content

Commit

Permalink
Merge branch 'release' into ukrainian-translation
Browse files Browse the repository at this point in the history
  • Loading branch information
wilbiev authored Dec 23, 2024
2 parents 9090efb + e1cc69a commit e3f428d
Show file tree
Hide file tree
Showing 50 changed files with 1,463 additions and 8,075 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ repos:
- id: "pyupgrade"
args: ["--py39-plus"]

- repo: "https://github.com/pre-commit/mirrors-isort"
rev: "v5.10.1"
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: "isort"
- id: isort

- repo: "https://github.com/psf/black"
rev: "22.3.0"
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
![hacs installs](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Flauwbier.nl%2Fhacs%2Fui_lovelace_minimalist)
![Downloads](https://img.shields.io/github/downloads/UI-Lovelace-Minimalist/UI/total)

> [!IMPORTANT]
> Looking for New Maintainers!
>
> This project is in need of new maintainers! The current maintainers are no longer actively working on it, and without fresh leadership, we may be forced to shut down the project and its associated Discord server.
>
> If you're passionate about this project and would like to take over its development and community management, we’d love to hear from you!
>
> - Join us on Discord to discuss further: [Thread Message](https://discord.com/channels/923363055444832296/928986459975876668/1314292139139534979)
> - Or reach out on GitHub Discussions: [GitHub discussion](https://github.com/UI-Lovelace-Minimalist/UI/discussions/1560)
>
> Thank you for considering helping keep this project alive and thriving! 🙌
It's kind of hard to explain what this is, so let's call it a "theme" (in quotation marks). But one thing is for sure, it is very nice! Taking the exceptional work of tben as a basis, this repository is aimed to ease installation and maintenance of his wonderful work. You can use this interpretation of a SmartHomeUI more or less like a theme in HomeAssistant.

<img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_home.png" width="200"> <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_temperature.png" width="200"> <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_consumption.png" width="200"> <img src="https://raw.githubusercontent.com/UI-Lovelace-Minimalist/UI/main/docs/assets/img/example_localisation.png" width="200">
Expand Down
39 changes: 28 additions & 11 deletions custom_components/ui_lovelace_minimalist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"""Custom Integration to setup UI Lovelace Minimalist."""

from __future__ import annotations

import logging
from typing import Any

from aiogithubapi import AIOGitHubAPIException, GitHubAPI
from homeassistant.components import frontend
from homeassistant.components.frontend import async_remove_panel
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.core import Config, HomeAssistant
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.loader import async_get_integration

Expand Down Expand Up @@ -64,7 +65,6 @@ async def async_initialize_integration(

ulm.integration = integration
ulm.version = integration.version
ulm.session = clientsession
ulm.hass = hass
ulm.system.running = True
ulm.githubapi = GitHubAPI(
Expand All @@ -89,11 +89,10 @@ async def async_startup():
await ulm.fetch_cards()
await ulm.configure_community_cards()

if (
not await ulm.configure_ulm()
or not await ulm.configure_plugins()
or not await ulm.configure_dashboard()
):
ResponseConfigure = await ulm.configure_ulm()
ResponsePlugins = await ulm.configure_plugins()
ResponseDashboard = await ulm.configure_dashboard()
if not ResponseConfigure or not ResponsePlugins or not ResponseDashboard:
return False

ulm.enable_ulm()
Expand All @@ -112,15 +111,17 @@ async def async_startup():
return True


async def async_setup(hass: HomeAssistant, config: Config):
async def async_setup(hass: HomeAssistant, config: dict):
"""Set up this integration using UI."""
return await async_initialize_integration(hass=hass, config=config)


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

config_entry.add_update_listener(async_reload_entry)
config_entry.async_on_unload(
config_entry.add_update_listener(config_entry_update_listener)
)
return await async_initialize_integration(hass=hass, config_entry=config_entry)


Expand All @@ -131,11 +132,27 @@ async def async_remove_entry(hass: HomeAssistant, config_entry: ConfigEntry):
# TODO cleanup:
# - themes
# - blueprints
frontend.async_remove_panel(hass, "ui-lovelace-minimalist")
async_remove_panel(hass, "ui-lovelace-minimalist")


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

await async_setup_entry(hass, config_entry)


async def config_entry_update_listener(
hass: HomeAssistant, config_entry: ConfigEntry
) -> None:
"""Update listener, called when the config entry options are changed."""
_LOGGER.debug("Start config_entry_update async_reload")

await hass.config_entries.async_reload(config_entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry):
"""Unload Integration."""
_LOGGER.debug("Unload the config entry")

return await async_initialize_integration(hass=hass, config_entry=config_entry)
Loading

0 comments on commit e3f428d

Please sign in to comment.