mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 00:54:28 +05:00
add yaml deprecation
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
"""The mega integration."""
|
||||
import asyncio
|
||||
import logging
|
||||
import typing
|
||||
from functools import partial
|
||||
|
||||
import voluptuous as vol
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PLATFORM, CONF_SCAN_INTERVAL, CONF_ID
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_component import EntityComponent
|
||||
from homeassistant.helpers.service import bind_hass
|
||||
from homeassistant.components import mqtt
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
@@ -74,9 +71,10 @@ async def async_setup(hass: HomeAssistant, config: dict):
|
||||
if CONF_HOST in conf:
|
||||
conf = {DEF_ID: conf}
|
||||
for id, data in conf.items():
|
||||
_LOGGER.warning('YAML configuration is deprecated, please use web-interface')
|
||||
await _add_mega(hass, id, data)
|
||||
|
||||
for id, hub in hass.data[DOMAIN].__items__():
|
||||
for id, hub in hass.data[DOMAIN].items():
|
||||
_POLL_TASKS[id] = asyncio.create_task(hub.poll())
|
||||
return True
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""Platform for light integration."""
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -18,7 +16,6 @@ from homeassistant.const import (
|
||||
CONF_ID
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from .entities import BaseMegaEntity
|
||||
|
||||
from .hub import MegaD
|
||||
|
||||
@@ -9,7 +9,7 @@ from homeassistant.components import mqtt
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_ID, CONF_PASSWORD, CONF_SCAN_INTERVAL
|
||||
from homeassistant.core import callback
|
||||
from .const import DOMAIN, CONF_PORT_TO_SCAN, CONF_RELOAD, CONF_INVERT # pylint:disable=unused-import
|
||||
from .const import DOMAIN, CONF_PORT_TO_SCAN, CONF_RELOAD # pylint:disable=unused-import
|
||||
from .hub import MegaD
|
||||
from . import exceptions
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""Platform for light integration."""
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -19,7 +17,6 @@ from homeassistant.const import (
|
||||
CONF_ID
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from .entities import BaseMegaEntity
|
||||
|
||||
from .hub import MegaD
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Platform for light integration."""
|
||||
import logging
|
||||
|
||||
import typing
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
"""Platform for light integration."""
|
||||
import json
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -13,11 +12,7 @@ from homeassistant.const import (
|
||||
CONF_PLATFORM,
|
||||
CONF_PORT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from .entities import BaseMegaEntity
|
||||
|
||||
from .hub import MegaD
|
||||
from .const import CONF_DIMMER, CONF_SWITCH
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
Reference in New Issue
Block a user