Skip to content

Commit

Permalink
Fix HA and GitHub Actions issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wilbiev committed Dec 25, 2024
1 parent e42d143 commit d88d958
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions custom_components/ui_lovelace_minimalist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.loader import async_get_integration
import voluptuous as vol

from .base import UlmBase
from .const import DOMAIN, NAME
from .enums import ConfigurationType, UlmDisabledReason

_LOGGER: logging.Logger = logging.getLogger(__package__)

CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA)


async def async_initialize_integration(
hass: HomeAssistant,
Expand Down
11 changes: 10 additions & 1 deletion custom_components/ui_lovelace_minimalist/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

from aiogithubapi import GitHubDeviceAPI, GitHubException
from aiogithubapi.common.const import OAUTH_USER_LOGIN
from awesomeversion import AwesomeVersion
from homeassistant import config_entries
from homeassistant.const import __version__ as HAVERSION
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -51,6 +53,10 @@

_LOGGER: logging.Logger = logging.getLogger(__name__)

# Version threshold for config_entry setting in options flow
# See: https://github.com/home-assistant/core/pull/129562
HA_OPTIONS_FLOW_VERSION_THRESHOLD = "2024.11.99"


async def ulm_config_option_schema(options: dict = {}) -> dict:
"""Return a schema for ULM configuration options."""
Expand Down Expand Up @@ -242,7 +248,10 @@ class UlmOptionFlowHandler(config_entries.OptionsFlow):

def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize."""
self.config_entry = config_entry
self.options = dict(config_entry.options)
# See: https://github.com/home-assistant/core/pull/129562
if AwesomeVersion(HAVERSION) < HA_OPTIONS_FLOW_VERSION_THRESHOLD:
self.config_entry = config_entry

async def async_step_init(self, _user_input=None):
"""Manage the options."""
Expand Down
2 changes: 2 additions & 0 deletions custom_components/ui_lovelace_minimalist/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
},
"services": {
"reload": {
"name": "Reload",
"description": "Reload dashboard configuration for UI Lovelace Minimalist."
},
"installed": {
"name": "Installed",
"description": "Change the installed key in global config for UI Lovelace Minimalist."
}
}
Expand Down

0 comments on commit d88d958

Please sign in to comment.