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
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ omit =
homeassistant/components/iaqualink/sensor.py
homeassistant/components/iaqualink/switch.py
homeassistant/components/icloud/device_tracker.py
homeassistant/components/izone/climate.py
homeassistant/components/izone/discovery.py
homeassistant/components/izone/__init__.py
homeassistant/components/idteck_prox/*
homeassistant/components/ifttt/*
homeassistant/components/iglo/light.py
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ homeassistant/components/ios/* @robbiet480
homeassistant/components/ipma/* @dgomes
homeassistant/components/iqvia/* @bachya
homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/izone/* @Swamp-Ig
homeassistant/components/jewish_calendar/* @tsvi
homeassistant/components/keba/* @dannerph
homeassistant/components/knx/* @Julius2342
Expand Down
15 changes: 15 additions & 0 deletions homeassistant/components/izone/.translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"no_devices_found": "No iZone devices found on the network.",
"single_instance_allowed": "Only a single configuration of iZone is necessary."
},
"step": {
"confirm": {
"description": "Do you want to set up iZone?",
"title": "iZone"
}
},
"title": "iZone"
}
}
67 changes: 67 additions & 0 deletions homeassistant/components/izone/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""
Platform for the iZone AC.

For more details about this component, please refer to the documentation
https://home-assistant.io/components/izone/
"""
import logging

import voluptuous as vol

from homeassistant import config_entries
from homeassistant.const import CONF_EXCLUDE
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.typing import ConfigType, HomeAssistantType

from .const import IZONE, DATA_CONFIG
from .discovery import async_start_discovery_service, async_stop_discovery_service

_LOGGER = logging.getLogger(__name__)

CONFIG_SCHEMA = vol.Schema(
{
IZONE: vol.Schema(
{
vol.Optional(CONF_EXCLUDE, default=[]): vol.All(
cv.ensure_list, [cv.string]
)
}
)
},
extra=vol.ALLOW_EXTRA,
)


async def async_setup(hass: HomeAssistantType, config: ConfigType):
"""Register the iZone component config."""
conf = config.get(IZONE)
if not conf:
return True

hass.data[DATA_CONFIG] = conf

# Explicitly added in the config file, create a config entry.
hass.async_create_task(
hass.config_entries.flow.async_init(
IZONE, context={"source": config_entries.SOURCE_IMPORT}
)
)

return True


async def async_setup_entry(hass, entry):
"""Set up from a config entry."""
await async_start_discovery_service(hass)

hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "climate")
)
return True


async def async_unload_entry(hass, entry):
"""Unload the config entry and stop discovery process."""
await async_stop_discovery_service(hass)
await hass.config_entries.async_forward_entry_unload(entry, "climate")
return True
Loading