core/homeassistant/components/lightwave/__init__.py

104 lines
3.3 KiB
Python
Raw Normal View History

"""Support for device connected via Lightwave WiFi-link hub."""
2023-05-24 11:44:12 +00:00
import logging
from lightwave.lightwave import LWLink
import voluptuous as vol
from homeassistant.const import (
CONF_HOST,
CONF_LIGHTS,
CONF_NAME,
CONF_SWITCHES,
Platform,
)
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import async_load_platform
from homeassistant.helpers.typing import ConfigType
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
CONF_SERIAL = "serial"
CONF_PROXY_IP = "proxy_ip"
CONF_PROXY_PORT = "proxy_port"
CONF_TRV = "trv"
CONF_TRVS = "trvs"
DEFAULT_PROXY_PORT = 7878
2019-07-31 19:25:30 +00:00
DOMAIN = "lightwave"
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
LIGHTWAVE_LINK = f"{DOMAIN}_link"
LIGHTWAVE_TRV_PROXY = f"{DOMAIN}_proxy"
LIGHTWAVE_TRV_PROXY_PORT = f"{DOMAIN}_proxy_port"
2023-05-24 11:44:12 +00:00
_LOGGER = logging.getLogger(__name__)
2019-07-31 19:25:30 +00:00
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.Schema(
vol.All(
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
cv.has_at_least_one_key(CONF_LIGHTS, CONF_SWITCHES, CONF_TRV),
2019-07-31 19:25:30 +00:00
{
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_LIGHTS, default={}): {
cv.string: vol.Schema({vol.Required(CONF_NAME): cv.string})
},
vol.Optional(CONF_SWITCHES, default={}): {
cv.string: vol.Schema({vol.Required(CONF_NAME): cv.string})
},
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
vol.Optional(CONF_TRV, default={}): {
vol.Optional(
CONF_PROXY_PORT, default=DEFAULT_PROXY_PORT
): cv.port,
2023-05-24 11:44:12 +00:00
vol.Optional(CONF_PROXY_IP): cv.string,
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
vol.Required(CONF_TRVS, default={}): {
cv.string: vol.Schema(
{
vol.Required(CONF_NAME): cv.string,
vol.Required(CONF_SERIAL): cv.string,
}
)
},
},
2019-07-31 19:25:30 +00:00
},
)
)
},
extra=vol.ALLOW_EXTRA,
)
PLATFORMS = (Platform.CLIMATE, Platform.SENSOR)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Try to start embedded Lightwave broker."""
host = config[DOMAIN][CONF_HOST]
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
lwlink = LWLink(host)
hass.data[LIGHTWAVE_LINK] = lwlink
2021-10-19 02:36:35 +00:00
if lights := config[DOMAIN][CONF_LIGHTS]:
2019-07-31 19:25:30 +00:00
hass.async_create_task(
async_load_platform(hass, Platform.LIGHT, DOMAIN, lights, config)
2019-07-31 19:25:30 +00:00
)
2021-10-19 02:36:35 +00:00
if switches := config[DOMAIN][CONF_SWITCHES]:
2019-07-31 19:25:30 +00:00
hass.async_create_task(
async_load_platform(hass, Platform.SWITCH, DOMAIN, switches, config)
2019-07-31 19:25:30 +00:00
)
2021-10-19 02:36:35 +00:00
if trv := config[DOMAIN][CONF_TRV]:
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
trvs = trv[CONF_TRVS]
2023-05-24 11:44:12 +00:00
proxy_ip = trv.get(CONF_PROXY_IP)
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
proxy_port = trv[CONF_PROXY_PORT]
2023-05-24 11:44:12 +00:00
if proxy_ip is None:
await lwlink.LW_listen()
else:
lwlink.set_trv_proxy(proxy_ip, proxy_port)
_LOGGER.warning(
"Proxy no longer required, remove `proxy_ip` from config to use builtin listener"
)
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
for platform in PLATFORMS:
Add Lightwave TRV (#31665) * Add a shadow for covers that do not support postion * Rename shadow as optimistic * Add TRV support * Revert "Rename shadow as optimistic" This reverts commit e6e1db9cfba082c8e52d7fff57b4d79306f0de49. * Revert "Add a shadow for covers that do not support postion" This reverts commit 4f53e2c6c6ec955d673ab1f66b7107e1f4651374. * fix logic error * Modified configuration * Modified configuration (2) * ATTR_BATTERY_LEVEL * move socket code to library 2 * requirements_all.txt * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Style changes requested by @sprintstan * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/__init__.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Black * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> * Remove device_attr * remove redundant proxy parameters, left over from previous change * remove device id - not used * add comment on inhibit flag * pylint * fix config logic error * revert suggested change: need different behaviour with None & 0 * touch * backoff error in rebase change * Requesed code changes from @springstan * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/climate.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/lightwave/sensor.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> * Changes requested by @MartinHjelmare * Clean temp step constant Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-13 02:35:47 +00:00
hass.async_create_task(
async_load_platform(hass, platform, DOMAIN, trvs, config)
)
return True