8000 0.97.2 by balloob · Pull Request #25884 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0.97.2 #25884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 12, 2019
Merged

0.97.2 #25884

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions homeassistant/components/knx/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ async def after_update_callback(device):
await self.async_update_ha_state()

self.device.register_device_updated_cb(after_update_callback)
self.device.mode.register_device_updated_cb(after_update_callback)

@property
def name(self) -> str:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/netatmo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None):

auth = hass.data[DATA_NETATMO_AUTH]

home_data = HomeData(auth)
try:
home_data = HomeData(auth)
home_data.setup()
except pyatmo.NoDevice:
return

Expand Down Expand Up @@ -352,7 +353,6 @@ def __init__(self, auth, home=None):

def get_home_ids(self):
"""Get all the home ids returned by NetAtmo API."""
self.setup()
if self.homedata is None:
return []
for home_id in self.homedata.homes:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/netatmo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Netatmo",
"documentation": "https://www.home-assistant.io/components/netatmo",
"requirements": [
"pyatmo==2.2.0"
"pyatmo==2.2.1"
],
"dependencies": [
"webhook"
Expand Down
10 changes: 6 additions & 4 deletions homeassistant/components/nuki/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ def update(self):
self._nuki_lock.update(aggressive=False)
except requests.exceptions.RequestException:
self._available = False
else:
self._name = self._nuki_lock.name
self._locked = self._nuki_lock.is_locked
self._battery_critical = self._nuki_lock.battery_critical
return

self._available = self._nuki_lock.state != 255
self._name = self._nuki_lock.name
self._locked = self._nuki_lock.is_locked
self._battery_critical = self._nuki_lock.battery_critical

def lock(self, **kwargs):
"""Lock the device."""
Expand Down
13 changes: 6 additions & 7 deletions homeassistant/components/smartthings/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,35 +228,34 @@ async def async_update(self):
self._hvac_mode = MODE_TO_STATE.get(thermostat_mode)
if self._hvac_mode is None:
_LOGGER.debug(
"Device %s (%s) returned an invalid" "hvac mode: %s",
"Device %s (%s) returned an invalid hvac mode: %s",
self._device.label,
self._device.device_id,
thermostat_mode,
)

modes = set()
supported_modes = self._device.status.supported_thermostat_modes
if isinstance(supported_modes, Iterable):
operations = set()
for mode in supported_modes:
state = MODE_TO_STATE.get(mode)
if state is not None:
operations.add(state)
modes.add(state)
else:
_LOGGER.debug(
"Device %s (%s) returned an invalid "
"supported thermostat mode: %s",
"Device %s (%s) returned an invalid supported thermostat mode: %s",
self._device.label,
self._device.device_id,
mode,
)
self._hvac_modes = operations
else:
_LOGGER.debug(
"Device %s (%s) returned invalid supported " "thermostat modes: %s",
"Device %s (%s) returned invalid supported thermostat modes: %s",
self._device.label,
self._device.device_id,
supported_modes,
)
self._hvac_modes = list(modes)

@property
def current_humidity(self):
Expand Down
13 changes: 8 additions & 5 deletions homeassistant/components/unifi/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def is_connected(self):
CONF_DETECTION_TIME, DEFAULT_DETECTION_TIME
)

if self.device.last_seen and (
if self.device.state == 1 and (
dt_util.utcnow() - dt_util.utc_from_timestamp(float(self.device.last_seen))
< detection_time
):
Expand Down Expand Up @@ -339,15 +339,18 @@ def device_info(self):
@property
def device_state_attributes(self):
"""Return the device state attributes."""
if not self.device.last_seen:
if self.device.state == 0:
return {}

attributes = {}

attributes["upgradable"] = self.device.upgradable
attributes["overheating"] = self.device.overheating

if self.device.has_fan:
attributes["fan_level"] = self.device.fan_level

if self.device.overheating:
attributes["overheating"] = self.device.overheating

if self.device.upgradable:
attributes["upgradable"] = self.device.upgradable

return attributes
2 changes: 1 addition & 1 deletion homeassistant/components/unifi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/components/unifi",
"requirements": [
"aiounifi==10"
"aiounifi==11"
],
"dependencies": [],
"codeowners": [
Expand Down
F438
2 changes: 1 addition & 1 deletion homeassistant/components/vera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Vera",
"documentation": "https://www.home-assistant.io/components/vera",
"requirements": [
"pyvera==0.3.2"
"pyvera==0.3.3"
],
"dependencies": [],
"codeowners": []
Expand Down
12 changes: 9 additions & 3 deletions homeassistant/components/wink/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
SUPPORT_FAN_MODE,
SUPPORT_TARGET_TEMPERATURE,
SUPPORT_TARGET_TEMPERATURE_RANGE,
SUPPORT_PRESET_MODE,
PRESET_NONE,
)
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS
Expand Down Expand Up @@ -62,7 +63,7 @@
SUPPORT_FAN_THERMOSTAT = [FAN_AUTO, FAN_ON]
SUPPORT_PRESET_THERMOSTAT = [PRESET_AWAY, PRESET_ECO]

SUPPORT_FLAGS_AC = SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE
SUPPORT_FLAGS_AC = SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE | SUPPORT_PRESET_MODE
SUPPORT_FAN_AC = [FAN_HIGH, FAN_LOW, FAN_MEDIUM]
SUPPORT_PRESET_AC = [PRESET_NONE, PRESET_ECO]

Expand Down Expand Up @@ -415,10 +416,13 @@ def current_temperature(self):
@property
def preset_mode(self):
"""Return the current preset mode, e.g., home, away, temp."""
if not self.wink.is_on():
return PRESET_NONE

mode = self.wink.current_mode()
if mode == "auto_eco":
return PRESET_ECO
return None
return PRESET_NONE

@property
def preset_modes(self):
Expand All @@ -436,7 +440,7 @@ def hvac_mode(self) -> str:

wink_mode = self.wink.current_mode()
if wink_mode == "auto_eco":
return HVAC_MODE_AUTO
return HVAC_MODE_COOL
return WINK_HVAC_TO_HA.get(wink_mode)

@property
Expand Down Expand Up @@ -476,6 +480,8 @@ def set_preset_mode(self, preset_mode):
"""Set new preset mode."""
if preset_mode == PRESET_ECO:
self.wink.set_operation_mode("auto_eco")
elif self.hvac_mode == HVAC_MODE_COOL and preset_mode == PRESET_NONE:
self.set_hvac_mode(HVAC_MODE_COOL)

@property
def target_temperature(self):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 97
PATCH_VERSION = "1"
PATCH_VERSION = "2"
__short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION)
__version__ = "{}.{}".format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 6, 0)
Expand Down
6 changes: 3 additions & 3 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ aiopvapi==1.6.14
aioswitcher==2019.4.26

# homeassistant.components.unifi
aiounifi==10
aiounifi==11

# homeassistant.components.wwlln
aiowwlln==1.0.0
Expand Down Expand Up @@ -1046,7 +1046,7 @@ pyalarmdotcom==0.3.2
pyarlo==0.2.3

# homeassistant.components.netatmo
pyatmo==2.2.0
pyatmo==2.2.1

# homeassistant.components.apple_tv
pyatv==0.3.12
Expand Down Expand Up @@ -1566,7 +1566,7 @@ pyuptimerobot==0.0.5
# pyuserinput==0.1.11

# homeassistant.components.vera
pyvera==0.3.2
pyvera==0.3.3

# homeassistant.components.vesync
pyvesync==1.1.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ aionotion==1.1.0
aioswitcher==2019.4.26

# homeassistant.components.unifi
aiounifi==10
aiounifi==11

# homeassistant.components.wwlln
aiowwlln==1.0.0
Expand Down
25 changes: 13 additions & 12 deletions tests/components/smartthings/test_climate.py
Original file line number Diff line number Diff line change
3D11 Expand Up @@ -214,14 +214,14 @@ async def test_legacy_thermostat_entity_state(hass, legacy_thermostat):
| SUPPORT_TARGET_TEMPERATURE_RANGE
| SUPPORT_TARGET_TEMPERATURE
)
assert state.attributes[ATTR_HVAC_ACTIONS] == "idle"
assert state.attributes[ATTR_HVAC_MODES] == {
assert state.attributes[ATTR_HVAC_ACTIONS] == CURRENT_HVAC_IDLE
assert sorted(state.attributes[ATTR_HVAC_MODES]) == [
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_HEAT,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_OFF,
}
]
assert state.attributes[ATTR_FAN_MODE] == "auto"
assert state.attributes[ATTR_FAN_MODES] == ["auto", "on"]
assert state.attributes[ATTR_TARGET_TEMP_LOW] == 20 # celsius
Expand All @@ -239,12 +239,12 @@ async def test_basic_thermostat_entity_state(hass, basic_thermostat):
== SUPPORT_TARGET_TEMPERATURE_RANGE | SUPPORT_TARGET_TEMPERATURE
)
assert ATTR_HVAC_ACTIONS not in state.attributes
assert state.attributes[ATTR_HVAC_MODES] == {
HVAC_MODE_OFF,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_HEAT,
assert sorted(state.attributes[ATTR_HVAC_MODES]) == [
HVAC_MODE_COOL,
}
HVAC_MODE_HEAT,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_OFF,
]
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.1 # celsius


Expand All @@ -260,13 +260,13 @@ async def test_thermostat_entity_state(hass, thermostat):
| SUPPORT_TARGET_TEMPERATURE
)
assert state.attributes[ATTR_HVAC_ACTIONS] == CURRENT_HVAC_IDLE
assert state.attributes[ATTR_HVAC_MODES] == {
assert sorted(state.attributes[ATTR_HVAC_MODES]) == [
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
HVAC_MODE_HEAT,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_OFF,
}
]
assert state.attributes[ATTR_FAN_MODE] == "on"
assert state.attributes[ATTR_FAN_MODES] == ["auto", "on"]
assert state.attributes[ATTR_TEMPERATURE] == 20 # celsius
Expand All @@ -286,6 +286,7 @@ async def test_buggy_thermostat_entity_state(hass, buggy_thermostat):
assert state.state is STATE_UNKNOWN
assert state.attributes[ATTR_TEMPERATURE] is None
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.1 # celsius
assert state.attributes[ATTR_HVAC_MODES] == []


async def test_buggy_thermostat_invalid_mode(hass, buggy_thermostat):
Expand All @@ -295,7 +296,7 @@ async def test_buggy_thermostat_invalid_mode(hass, buggy_thermostat):
)
await setup_platform(hass, CLIMATE_DOMAIN, devices=[buggy_thermostat])
state = hass.states.get("climate.buggy_thermostat")
assert state.attributes[ATTR_HVAC_MODES] == {"heat"}
assert state.attributes[ATTR_HVAC_MODES] == [HVAC_MODE_HEAT]


async def test_air_conditioner_entity_state(hass, air_conditioner):
Expand Down
2 changes: 2 additions & 0 deletions tests/components/unifi/test_device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"model": "US16P150",
"name": "device_1",
"overheating": False,
"state": 1,
"type": "usw",
"upgradable": False,
"version": "4.0.42.10433",
Expand All @@ -81,6 +82,7 @@
"mac": "00:00:00:00:01:01",
"model": "US16P150",
"name": "device_1",
"state": 0,
"type": "usw",
"version": "4.0.42.10433",
}
Expand Down
0