Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions custom_components/gree_custom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Gree climate integration init."""

from __future__ import annotations

# Standard library imports
import logging

Expand Down Expand Up @@ -44,6 +42,7 @@
# Home Assistant imports
from .coordinator import GreeConfigEntry, GreeCoordinator
from .helpers import try_find_new_ip
from .services import async_setup_services

PLATFORMS = [
Platform.BINARY_SENSOR,
Expand All @@ -52,20 +51,22 @@
Platform.SENSOR,
Platform.SWITCH,
]

_LOGGER = logging.getLogger(__name__)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Gree component from yaml."""
if DOMAIN not in config:
return True
"""Set up the Gree component."""

async_setup_services(hass)

for climate_config in config[DOMAIN]:
# Setup YAML entries
for gree_config in config.get(DOMAIN, []):
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": "import"},
data=climate_config,
data=gree_config,
)
)

Expand Down
Loading
Loading