Skip to content

Commit

Permalink
chore(deps): update homeassistant/home-assistant docker tag to v2024.…
Browse files Browse the repository at this point in the history
…10.2
  • Loading branch information
jnewland-renovate committed Oct 11, 2024
1 parent 7bfe27b commit 780728d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
50 changes: 27 additions & 23 deletions custom_components/plant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

from . import group

import logging

import voluptuous as vol
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions custom_components/plant/group.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 780728d

Please sign in to comment.