From 780728d9f2e09124087fb8fcb12c42a805cf8279 Mon Sep 17 00:00:00 2001 From: jnewland-renovate <195354+jnewland-renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:05:17 +0000 Subject: [PATCH] chore(deps): update homeassistant/home-assistant docker tag to v2024.10.2 --- .github/workflows/deploy.yaml | 2 +- custom_components/plant/__init__.py | 50 ++++++++++++++++------------- custom_components/plant/group.py | 8 +++-- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6cb0dd11..4ff0a8b1 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -56,7 +56,7 @@ jobs: run: | openssl req -x509 -newkey rsa:1024 -subj '/CN=example.com' -nodes -keyout key.pem -out cert.pem - name: Test config - uses: docker://homeassistant/home-assistant:2024.10.1@sha256:f881515cefc888b91a0098cb64a22fa586aa863562aa07dcf9b87546bad5623f + uses: docker://homeassistant/home-assistant:2024.10.2@sha256:a6b2a25a4ae7d747506ad3a24bcaf1ee2290fb82811f077447b8847eecd29c56 with: entrypoint: ./script/cibuild script-deploy: diff --git a/custom_components/plant/__init__.py b/custom_components/plant/__init__.py index 205f16b4..f11e0c66 100644 --- a/custom_components/plant/__init__.py +++ b/custom_components/plant/__init__.py @@ -2,6 +2,8 @@ from __future__ import annotations +from . import group + import logging import voluptuous as vol @@ -81,29 +83,31 @@ SETUP_DUMMY_SENSORS = False USE_DUMMY_SENSORS = False - -async def async_setup(hass: HomeAssistant, config: dict): - """ - Set up the plant component - - Configuration.yaml is no longer used. - This function only tries to migrate the legacy config. - """ - if config.get(DOMAIN): - # Only import if we haven't before. - config_entry = _async_find_matching_config_entry(hass) - if not config_entry: - _LOGGER.debug("Old setup - with config: %s", config[DOMAIN]) - for plant in config[DOMAIN]: - if plant != DOMAIN_PLANTBOOK: - _LOGGER.info("Migrating plant: %s", plant) - await async_migrate_plant(hass, plant, config[DOMAIN][plant]) - else: - _LOGGER.warning( - "Config already imported. Please delete all your %s related config from configuration.yaml", - DOMAIN, - ) - return True +# Removed. +# Have not been used for a long time +# +# async def async_setup(hass: HomeAssistant, config: dict): +# """ +# Set up the plant component +# +# Configuration.yaml is no longer used. +# This function only tries to migrate the legacy config. +# """ +# if config.get(DOMAIN): +# # Only import if we haven't before. +# config_entry = _async_find_matching_config_entry(hass) +# if not config_entry: +# _LOGGER.debug("Old setup - with config: %s", config[DOMAIN]) +# for plant in config[DOMAIN]: +# if plant != DOMAIN_PLANTBOOK: +# _LOGGER.info("Migrating plant: %s", plant) +# await async_migrate_plant(hass, plant, config[DOMAIN][plant]) +# else: +# _LOGGER.warning( +# "Config already imported. Please delete all your %s related config from configuration.yaml", +# DOMAIN, +# ) +# return True @callback diff --git a/custom_components/plant/group.py b/custom_components/plant/group.py index 2ee18cba..e230159f 100644 --- a/custom_components/plant/group.py +++ b/custom_components/plant/group.py @@ -1,17 +1,19 @@ """Describe group states.""" -from __future__ import annotations +from typing import TYPE_CHECKING -from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OK, STATE_PROBLEM from homeassistant.core import HomeAssistant, callback +if TYPE_CHECKING: + from homeassistant.components.group import GroupIntegrationRegistry + from .const import DOMAIN @callback def async_describe_on_off_states( - hass: HomeAssistant, registry: GroupIntegrationRegistry + hass: HomeAssistant, registry: "GroupIntegrationRegistry" ) -> None: """Describe group on off states.""" registry.on_off_states(