Lifx legacy (#6847)

* Add legacy LIFX platform for Windows support

The async platform introduced in 9ef084d903 has
turned out to use Python functionality that is not available in Windows.

This commit restores the previous implementation, now named lifx_legacy.

* Add a comment about the platform being a legacy implementation

* Warn when using unsupported lifx platform on Windows

* Update .coveragerc
This commit is contained in:
Anders Melchiorsen 2017-03-30 08:00:22 +02:00 committed by Paulus Schoutsen
parent ead00e956f
commit 7b83a836f3
4 changed files with 289 additions and 0 deletions

View file

@ -7,6 +7,7 @@ https://home-assistant.io/components/light.lifx/
import colorsys
import logging
import asyncio
import sys
from functools import partial
from datetime import timedelta
@ -51,6 +52,10 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup the LIFX platform."""
import aiolifx
if sys.platform == 'win32':
_LOGGER.warning('The lifx platform is known to not work on Windows. '
'Consider using the lifx_legacy platform instead.')
server_addr = config.get(CONF_SERVER)
lifx_manager = LIFXManager(hass, async_add_devices)