core/homeassistant/components/lightwave/climate.py

109 lines
3.8 KiB
Python
Raw Normal View History

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
"""Support for LightwaveRF TRVs."""
from __future__ import annotations
2022-09-01 12:14:31 +00:00
from typing import Any
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
from homeassistant.components.climate import (
DEFAULT_MAX_TEMP,
DEFAULT_MIN_TEMP,
ClimateEntity,
ClimateEntityFeature,
HVACAction,
HVACMode,
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
)
from homeassistant.const import ATTR_TEMPERATURE, CONF_NAME, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
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
from . import CONF_SERIAL, LIGHTWAVE_LINK
async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
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
"""Find and return LightWave lights."""
if discovery_info is None:
return
entities = []
lwlink = hass.data[LIGHTWAVE_LINK]
for device_id, device_config in discovery_info.items():
name = device_config[CONF_NAME]
serial = device_config[CONF_SERIAL]
entities.append(LightwaveTrv(name, device_id, lwlink, serial))
async_add_entities(entities)
class LightwaveTrv(ClimateEntity):
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
"""Representation of a LightWaveRF TRV."""
_attr_hvac_mode = HVACMode.HEAT
_attr_hvac_modes = [HVACMode.HEAT, HVACMode.OFF]
_attr_min_temp = DEFAULT_MIN_TEMP
_attr_max_temp = DEFAULT_MAX_TEMP
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
_attr_target_temperature_step = 0.5
_attr_temperature_unit = UnitOfTemperature.CELSIUS
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
def __init__(self, name, device_id, lwlink, serial):
"""Initialize LightwaveTrv entity."""
self._attr_name = name
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
self._device_id = device_id
self._lwlink = lwlink
self._serial = serial
self._attr_unique_id = f"{serial}-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
# inhibit is used to prevent race condition on update. If non zero, skip next update cycle.
self._inhibit = 0
2022-09-01 12:14:31 +00:00
def update(self) -> None:
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
"""Communicate with a Lightwave RTF Proxy to get state."""
(temp, targ, _, trv_output) = self._lwlink.read_trv_status(self._serial)
if temp is not None:
self._attr_current_temperature = temp
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
if targ is not None:
if self._inhibit == 0:
self._attr_target_temperature = targ
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
if targ == 0:
# TRV off
self._attr_target_temperature = None
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
if targ >= 40:
# Call for heat mode, or TRV in a fixed position
self._attr_target_temperature = None
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
else:
# Done the job - use proxy next iteration
self._inhibit = 0
if trv_output is not None:
if trv_output > 0:
self._attr_hvac_action = HVACAction.HEATING
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
else:
self._attr_hvac_action = HVACAction.OFF
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
@property
def target_temperature(self):
"""Target room temperature."""
if self._inhibit > 0:
# If we get an update before the new temp has
# propagated, the target temp is set back to the
# old target on the next poll, showing a false
# reading temporarily.
self._attr_target_temperature = self._inhibit
return self._attr_target_temperature
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
2022-09-01 12:14:31 +00:00
def set_temperature(self, **kwargs: Any) -> None:
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
"""Set TRV target temperature."""
if ATTR_TEMPERATURE in kwargs:
self._attr_target_temperature = kwargs[ATTR_TEMPERATURE]
self._inhibit = self._attr_target_temperature
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
self._lwlink.set_temperature(
self._device_id, self._attr_target_temperature, self._attr_name
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
)
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
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
"""Set HVAC Mode for TRV."""