Deprecate LIFX Legacy integration (#47235)

pull/47257/head
Franck Nijhof 2021-03-02 01:34:14 +01:00 committed by GitHub
parent 4f9f870e7d
commit d1afef843b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -4,7 +4,6 @@ from datetime import timedelta
from functools import partial
import logging
import math
import sys
import aiolifx as aiolifx_module
import aiolifx_effects as aiolifx_effects_module
@ -166,12 +165,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up LIFX from a config entry."""
if sys.platform == "win32":
_LOGGER.warning(
"The lifx platform is known to not work on Windows. "
"Consider using the lifx_legacy platform instead"
)
# Priority 1: manual config
interfaces = hass.data[LIFX_DOMAIN].get(DOMAIN)
if not interfaces:

View File

@ -46,13 +46,22 @@ SUPPORT_LIFX = (
SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP | SUPPORT_COLOR | SUPPORT_TRANSITION
)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{vol.Optional(CONF_SERVER): cv.string, vol.Optional(CONF_BROADCAST): cv.string}
PLATFORM_SCHEMA = vol.All(
cv.deprecated(CONF_SERVER),
cv.deprecated(CONF_BROADCAST),
PLATFORM_SCHEMA.extend(
{vol.Optional(CONF_SERVER): cv.string, vol.Optional(CONF_BROADCAST): cv.string}
),
)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the LIFX platform."""
_LOGGER.warning(
"The LIFX Legacy platform is deprecated and will be removed in "
"Home Assistant Core 2021.6.0. Use the LIFX integration instead."
)
server_addr = config.get(CONF_SERVER)
broadcast_addr = config.get(CONF_BROADCAST)