mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add LIFX listen port advanced configuration (#20299)
This commit is contained in:
parent
ec5da05804
commit
c94834d8f6
@ -3,6 +3,7 @@ import voluptuous as vol
|
|||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
|
from homeassistant.const import CONF_PORT
|
||||||
from homeassistant.helpers import config_entry_flow
|
from homeassistant.helpers import config_entry_flow
|
||||||
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
|
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ CONF_BROADCAST = 'broadcast'
|
|||||||
|
|
||||||
INTERFACE_SCHEMA = vol.Schema({
|
INTERFACE_SCHEMA = vol.Schema({
|
||||||
vol.Optional(CONF_SERVER): cv.string,
|
vol.Optional(CONF_SERVER): cv.string,
|
||||||
|
vol.Optional(CONF_PORT): cv.port,
|
||||||
vol.Optional(CONF_BROADCAST): cv.string,
|
vol.Optional(CONF_BROADCAST): cv.string,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -22,7 +22,8 @@ from homeassistant.components.light import (
|
|||||||
SUPPORT_TRANSITION, VALID_BRIGHTNESS, VALID_BRIGHTNESS_PCT, Light,
|
SUPPORT_TRANSITION, VALID_BRIGHTNESS, VALID_BRIGHTNESS_PCT, Light,
|
||||||
preprocess_turn_on_alternatives)
|
preprocess_turn_on_alternatives)
|
||||||
from homeassistant.components.lifx import (
|
from homeassistant.components.lifx import (
|
||||||
DOMAIN as LIFX_DOMAIN, DATA_LIFX_MANAGER, CONF_SERVER, CONF_BROADCAST)
|
DOMAIN as LIFX_DOMAIN, DATA_LIFX_MANAGER, CONF_SERVER, CONF_PORT,
|
||||||
|
CONF_BROADCAST)
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, EVENT_HOMEASSISTANT_STOP
|
from homeassistant.const import ATTR_ENTITY_ID, EVENT_HOMEASSISTANT_STOP
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
@ -230,6 +231,9 @@ class LIFXManager:
|
|||||||
listen_ip = interface.get(CONF_SERVER)
|
listen_ip = interface.get(CONF_SERVER)
|
||||||
if listen_ip:
|
if listen_ip:
|
||||||
kwargs['listen_ip'] = listen_ip
|
kwargs['listen_ip'] = listen_ip
|
||||||
|
listen_port = interface.get(CONF_PORT)
|
||||||
|
if listen_port:
|
||||||
|
kwargs['listen_port'] = listen_port
|
||||||
lifx_discovery.start(**kwargs)
|
lifx_discovery.start(**kwargs)
|
||||||
|
|
||||||
self.discoveries.append(lifx_discovery)
|
self.discoveries.append(lifx_discovery)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user