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

0.27.2 #3151

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 15 commits into from
Sep 3, 2016
Merged

0.27.2 #3151

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
2 changes: 1 addition & 1 deletion homeassistant/components/apcupsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_HOST, default=DEFAULT_HOST): cv.string,
vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
}),
}, extra=vol.ALLOW_EXTRA)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/climate/ecobee.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def device_state_attributes(self):
else:
operation = status
return {
"humidity": self.thermostat['runtime']['actualHumidity'],
"actual_humidity": self.thermostat['runtime']['actualHumidity'],
"fan": self.fan,
"mode": self.mode,
"operation": operation,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/climate/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def set_operation_mode(self, operation_mode):
for mode, state in HM_STATE_MAP.items():
if state == operation_mode:
code = getattr(self._hmdevice, mode, 0)
self._hmdevice.STATE = code
self._hmdevice.MODE = code

@property
def min_temp(self):
Expand Down
43 changes: 21 additions & 22 deletions homeassistant/components/climate/zwave.py
1E0A
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from homeassistant.components.zwave import (
ATTR_NODE_ID, ATTR_VALUE_ID, ZWaveDeviceEntity)
from homeassistant.components import zwave
from homeassistant.const import (TEMP_FAHRENHEIT, TEMP_CELSIUS)
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -59,11 +59,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
_LOGGER.debug("No discovery_info=%s or no NETWORK=%s",
discovery_info, zwave.NETWORK)
return

temp_unit = hass.config.units.temperature_unit
node = zwave.NETWORK.nodes[discovery_info[ATTR_NODE_ID]]
value = node.values[discovery_info[ATTR_VALUE_ID]]
value.set_change_verified(False)
add_devices([ZWaveClimate(value)])
add_devices([ZWaveClimate(value, temp_unit)])
_LOGGER.debug("discovery_info=%s and zwave.NETWORK=%s",
discovery_info, zwave.NETWORK)

Expand All @@ -73,7 +73,7 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
"""Represents a ZWave Climate device."""

# pylint: disable=too-many-public-methods, too-many-instance-attributes
def __init__(self, value):
def __init__(self, value, temp_unit):
"""Initialize the zwave climate device."""
from openzwave.network import ZWaveNetwork
from pydispatch import dispatcher
Expand All @@ -87,7 +87,8 @@ def __init__(self, value):
self._fan_list = None
self._current_swing_mode = None
self._swing_list = None
self._unit = None
self._unit = temp_unit
_LOGGER.debug("temp_unit is %s", self._unit)
self._zxt_120 = None
self.update_properties()
# register listener
Expand Down Expand Up @@ -115,18 +116,6 @@ def value_changed(self, value):

def update_properties(self):
"""Callback on data change for the registered node/value pair."""
# Set point
for value in self._node.get_values(
class_id=COMMAND_CLASS_THERMOSTAT_SETPOINT).values():
self._unit = value.units
if self.current_operation is not None:
if SET_TEMP_TO_INDEX.get(self._current_operation) \
!= value.index:
continue
if self._zxt_120:
continue
self._target_temperature = int(value.data)

# Operation Mode
for value in self._node.get_values(
class_id=COMMAND_CLASS_THERMOSTAT_MODE).values():
Expand All @@ -140,6 +129,7 @@ def update_properties(self):
class_id=COMMAND_CLASS_SENSOR_MULTILEVEL).values():
if value.label == 'Temperature':
self._current_temperature = int(value.data)
self._unit = value.units
# Fan Mode
for value in self._node.get_values(
class_id=COMMAND_CLASS_THERMOSTAT_FAN_MODE).values():
Expand All @@ -158,6 +148,17 @@ def update_properties(self):
_LOGGER.debug("self._swing_list=%s", self._swing_list)
_LOGGER.debug("self._current_swing_mode=%s",
self._current_swing_mode)
# Set point
for value in self._node.get_values(
class_id=COMMAND_CLASS_THERMOSTAT_SETPOINT).values():
if self.current_operation is not None and \
self.current_operation != 'Off':
if SET_TEMP_TO_INDEX.get(self._current_operation) \
!= value.index:
continue
if self._zxt_120:
continue
self._target_temperature = int(value.data)

@property
def should_poll(self):
Expand Down Expand Up @@ -187,14 +188,12 @@ def swing_list(self):
@property
def unit_of_measurement(self):
"""Return the unit of measurement."""
unit = self._unit
if unit == 'C':
if self._unit == 'C':
return TEMP_CELSIUS
elif unit == 'F':
elif self._unit == 'F':
return TEMP_FAHRENHEIT
else:
_LOGGER.exception("unit_of_measurement=%s is not valid",
unit)
return self._unit

@property
def current_temperature(self):
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/cover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
SERVICE_STOP_COVER: {'method': 'stop_cover'},
SERVICE_OPEN_COVER_TILT: {'method': 'open_cover_tilt'},
SERVICE_CLOSE_COVER_TILT: {'method': 'close_cover_tilt'},
SERVICE_STOP_COVER_TILT: {'method': 'stop_cover_tilt'},
SERVICE_SET_COVER_TILT_POSITION: {
'method': 'set_cover_tilt_position',
'schema': COVER_SET_COVER_TILT_POSITION_SCHEMA},
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/cover/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import logging
from homeassistant.const import STATE_UNKNOWN
from homeassistant.components.cover import CoverDevice,\
ATTR_CURRENT_POSITION
ATTR_POSITION
import homeassistant.components.homematic as homematic

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -41,16 +41,16 @@ def current_cover_position(self):
None is unknown, 0 is closed, 100 is fully open.
"""
if self.available:
return int((1 - self._hm_get_state()) * 100)
return int(self._hm_get_state() * 100)
return None

def set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""
if self.available:
if ATTR_CURRENT_POSITION in kwargs:
position = float(kwargs[ATTR_CURRENT_POSITION])
if ATTR_POSITION in kwargs:
position = float(kwargs[ATTR_POSITION])
position = min(100, max(0, position))
level = (100 - position) / 100.0
level = position / 100.0
self._hmdevice.set_level(level, self._channel)

@property
Expand Down
12 changes: 6 additions & 6 deletions homeassistant/components/cover/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,16 @@ def message_received(topic, payload, qos):
hass, value_template, payload)
6377 if payload == self._state_open:
self._state = False
_LOGGER.warning("state=%s", int(self._state))
self.update_ha_state()
elif payload == self._state_closed:
self._state = True
self.update_ha_state()
elif payload.isnumeric() and 0 <= int(payload) <= 100:
self._state = int(payload)
if int(payload) > 0:
self._state = False
else:
self._state = True
self._position = int(payload)
self.update_ha_state()
else:
Expand All @@ -129,11 +133,7 @@ def name(self):
@property
def is_closed(self):
"""Return if the cover is closed."""
if self.current_cover_position is not None:
if self.current_cover_position > 0:
return False
else:
return True
return self._state

@property
def current_cover_position(self):
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/cover/zwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def update_properties(self):
@property
def is_closed(self):
"""Return if the cover is closed."""
if self.current_cover_position is None:
return None
if self.current_cover_position > 0:
return False
else:
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/device_tracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ def load_config(path: str, hass: HomeAssistantType, consider_home: timedelta):
try:
return [
Device(hass, consider_home, device.get('track', False),
str(dev_id).lower(), str(device.get('mac')).upper(),
str(dev_id).lower(), None if device.get('mac') is None
else str(device.get('mac')).upper(),
device.get('name'), device.get('picture'),
device.get('gravatar'),
device.get(CONF_AWAY_HIDE, DEFAULT_AWAY_HIDE))
Expand Down
21 changes: 16 additions & 5 deletions homeassistant/components/device_tracker/bluetooth_le_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@
import logging
from datetime import timedelta

import voluptuous as vol
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES,
CONF_TRACK_NEW,
CONF_SCAN_INTERVAL,
DEFAULT_SCAN_INTERVAL,
PLATFORM_SCHEMA,
load_config,
)
import homeassistant.util as util
import homeassistant.util.dt as dt_util
import homeassistant.helpers.config_validation as cv

_LOGGER = logging.getLogger(__name__)

REQUIREMENTS = ['gattlib==0.20150805']

BLE_PREFIX = 'BLE_'
MIN_SEEN_NEW = 5
CONF_SCAN_DURATION = "scan_duration"

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_SCAN_DURATION, default=10): cv.positive_int
})


def setup_scanner(hass, config, see):
Expand Down Expand Up @@ -51,12 +59,13 @@ def discover_ble_devices():
"""Discover Bluetooth LE devices."""
_LOGGER.debug("Discovering Bluetooth LE devices")
service = DiscoveryService()
devices = service.discover(10)
devices = service.discover(duration)
_LOGGER.debug("Bluetooth LE devices discovered = %s", devices)

return devices

yaml_path = hass.config.path(YAML_DEVICES)
duration = config.get(CONF_SCAN_DURATION)
devs_to_track = []
devs_donot_track = []

Expand All @@ -65,11 +74,13 @@ def discover_ble_devices():
# to 0
for device in load_config(yaml_path, hass, 0):
# check if device is a valid bluetooth device
if device.mac and device.mac[:3].upper() == BLE_PREFIX:
if device.mac and device.mac[:4].upper() == BLE_PREFIX:
if device.track:
devs_to_track.append(device.mac[3:])
_LOGGER.debug("Adding %s to BLE tracker", device.mac)
devs_to_track.append(device.mac[4:])
else:
devs_donot_track.append(device.mac[3:])
_LOGGER.debug("Adding %s to BLE do not track", device.mac)
devs_donot_track.append(device.mac[4:])

# if track new devices is true discover new devices
# on every scan.
Expand All @@ -96,7 +107,7 @@ def update_ble(now):
if track_new:
for address in devs:
if address not in devs_to_track and \
address not in devs_donot_track:
address not in devs_donot_track:
_LOGGER.info("Discovered Bluetooth LE device %s", address)
see_device(address, devs[address], new_device=True)

Expand Down
66 changes: 0 additions & 66 deletions homeassistant/components/fan/insteon_hub.py

This file was deleted.

2 changes: 1 addition & 1 deletion homeassistant/components/frontend/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FINGERPRINTS = {
"core.js": "1fd10c1fcdf56a61f60cf861d5a0368c",
"frontend.html": "88c97d278de3320278da6c32fe9e7d61",
"frontend.html": "610cc799225ede933a9894b64bb35717",
"mdi.html": "710b84acc99b32514f52291aba9cd8e8",
"panels/ha-panel-dev-event.html": "3cc881ae8026c0fba5aa67d334a3ab2b",
"panels/ha-panel-dev-info.html": "34e2df1af32e60fffcafe7e008a92169",
Expand Down
Binary file modified homeassistant/components/frontend/www_static/core.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions homeassistant/components/frontend/www_static/frontend.html

Large diffs are not rendered by default.

Binary file modified homeassistant/components/frontend/www_static/frontend.html.gz
Binary file not shown.
Binary file modified homeassistant/components/frontend/www_static/mdi.html.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
0