Skip to content
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

0.23 #2381

Merged
merged 87 commits into from
Jul 1, 2016
Merged

0.23 #2381

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
44177a7
Version bump to 0.23.0.dev0
balloob Jun 18, 2016
cb6f50b
Envisalink support (#2304)
Cinntax Jun 19, 2016
f59e242
fix insteon hub discovery
balloob Jun 20, 2016
2e62053
Basic implementation of Zwave Rollershutters (#2313)
turbokongen Jun 20, 2016
cbc0833
Support for Sony Bravia TV (#2243)
antonioparraga Jun 20, 2016
5efa076
Make sure we exit loop when value is set (#2326)
turbokongen Jun 20, 2016
6fa095f
Add additional Pushover parameters (#2309)
dale3h Jun 20, 2016
ba417a7
Upgrade slacker to 0.9.17 (#2340)
fabaff Jun 20, 2016
caa096e
Upgrade psutil to 4.3.0 (#2342)
fabaff Jun 21, 2016
38b0336
Upgrade paho-mqtt to 1.2 (#2339)
fabaff Jun 21, 2016
278514b
Add support for Fixer.io (#2336)
fabaff Jun 21, 2016
d87e969
add cec platform
Jun 20, 2016
7fc9fa4
satisfy farcy
happyleavesaoc Jun 21, 2016
a564fe8
Fix error log (#2349)
balloob Jun 22, 2016
d7b0066
[notify.pushover] Fix 'NoneType' error on data retrieval (#2352)
dale3h Jun 22, 2016
9ce9b8d
Add support for wind, battery, radio signals for Netatmo sensor (#2351)
Jypy Jun 22, 2016
a70f922
ps - add reload core config service (#2350)
balloob Jun 22, 2016
7b94224
Increase interval (#2353)
fabaff Jun 22, 2016
94b47d8
addressed review
happyleavesaoc Jun 22, 2016
d0ee8ab
couple fixes
happyleavesaoc Jun 22, 2016
aa3d0e1
Fix incorrect check on presence of password and pub_key (#2355)
mtreinish Jun 23, 2016
12e26d2
Bump to pyenvisalink 1.0 (#2358)
Cinntax Jun 23, 2016
3349bdc
Log successful and failed login attempts (#2347)
fabaff Jun 23, 2016
600a3e3
Allow service data to be passed to shell_command (#2362)
dale3h Jun 23, 2016
67a04c2
Initial clean import
pvizeli Jun 24, 2016
ec8dc25
Zwave garagedoor (#2361)
turbokongen Jun 24, 2016
dfe1b8d
Fixed minor feature-detection bug with incomplet configuration
danielperna84 Jun 24, 2016
c616115
rpi_gpi garage_door controller (#2369)
kellerza Jun 25, 2016
68df3de
ABC consistent not implemented behavior (#2359)
balloob Jun 25, 2016
aadd730
Merge branch 'pr/2348' into dev
balloob Jun 25, 2016
7a8c5a0
Add frontend to the example config (#2367)
Danielhiversen Jun 25, 2016
e4b67c9
Add persistent notification component (#1844)
fabaff Jun 25, 2016
cbb897b
Update frontend
balloob Jun 25, 2016
a1ef1c9
Fix physical manual update of state of device (#2372)
turbokongen Jun 25, 2016
2ac752d
Add OpenExchangeRates sensor (#2356)
arsaboo Jun 25, 2016
1c1d180
Add cmus media device (#2321)
mtreinish Jun 25, 2016
7b02dc4
Secrets support for configuration files (#2312)
kellerza Jun 25, 2016
04748e3
First batch of (minor) fixes as suggested by @balloob
danielperna84 Jun 25, 2016
5ca26fc
Moved try/except-block and moved delay to link_homematic
danielperna84 Jun 25, 2016
43faeff
Moved trx/except, added debug messages, minor fixes
danielperna84 Jun 25, 2016
30b7c6b
Second batch of (minor) fixes as suggested by @balloob
pvizeli Jun 25, 2016
a19f7bf
fix false autodetect with HM GongSensor types
pvizeli Jun 25, 2016
b3acd7d
add resolvenames function support from pyhomematic (homegear only)
pvizeli Jun 25, 2016
87c138c
Third batch of (minor) fixes as suggested by @balloob
pvizeli Jun 25, 2016
86ccf26
fix autodiscovery
pvizeli Jun 25, 2016
be72b04
fix discovery function
pvizeli Jun 25, 2016
21381a9
Zwave fixes. (#2373)
turbokongen Jun 25, 2016
57754cd
Revert "fix discovery function"
pvizeli Jun 25, 2016
199fbc7
Revert "fix autodiscovery"
pvizeli Jun 25, 2016
a687bdb
Revert "Third batch of (minor) fixes as suggested by @balloob"
pvizeli Jun 25, 2016
e0e9d3c
change autodiscovery
pvizeli Jun 25, 2016
7e7f7b6
Merge remote-tracking branch 'refs/remotes/home-assistant/dev' into dev
pvizeli Jun 25, 2016
e4d3b25
Merge remote-tracking branch 'refs/remotes/home-assistant/dev' into H…
pvizeli Jun 25, 2016
4ecd724
fix linter errors
pvizeli Jun 25, 2016
f3199e7
fix wrong import
pvizeli Jun 25, 2016
c3b25f2
fix logging-not-lazy
pvizeli Jun 25, 2016
206e7d7
Extend persistent notification support (#2371)
balloob Jun 25, 2016
446f998
Merge pull request #2368 from pvizeli/Homematic
balloob Jun 26, 2016
d13cc22
Push State (#2365)
philipbl Jun 26, 2016
254b1c4
Remove lxml dependency (#2374)
fabaff Jun 26, 2016
fb3e388
Depreciate ssl2/3 (#2375)
danieljkemp Jun 26, 2016
3afc566
Fix timing bug while linking HM device to HA object
pvizeli Jun 26, 2016
d2509ce
Merge remote-tracking branch 'refs/remotes/home-assistant/dev' into dev
pvizeli Jun 27, 2016
dc75b28
Initial Support for Zwave color bulbs (#2376)
emlove Jun 27, 2016
6714392
Move elevation to core config and clean up HTTP mocking in tests (#2378)
balloob Jun 27, 2016
592c599
Upgrade Werkzeug to 0.11.10 (#2380)
fabaff Jun 28, 2016
d0b9b58
Merge branch 'master' into dev
balloob Jun 28, 2016
7a73dc7
Upgrade websocket-client to 0.37.0 (#2382)
fabaff Jun 28, 2016
0017976
Upgrade influxdb to 3.0.0 (#2383)
fabaff Jun 28, 2016
baa9bdf
change homematic to autodetect only
pvizeli Jun 28, 2016
31d2a5d
Reenable TLS1.1 and 1.2 while leaving SSLv3 disabled (#2385)
chennin Jun 28, 2016
78e7e17
Support more types of 1wire sensors and bus masters (#2384)
ardzeus Jun 29, 2016
3c5c018
Fixed issue with roku timeouts throwing exceptions when roku losses n…
Jun 29, 2016
bb0f484
update pyhomematic and homematic use now events from HA for remotes
pvizeli Jun 29, 2016
6a81611
Wink subscription support (#2324)
Jun 29, 2016
5cce02a
vera lock support (#2391)
rhooper Jun 30, 2016
8dd7ebb
Add the two next trains (#2390)
fabaff Jun 30, 2016
419ff18
Docstrings (#2395)
fabaff Jun 30, 2016
7582eb9
jsonrpc-request version bump (0.3) (#2397)
Jun 30, 2016
d1f4901
Migrate to cherrypy wsgi from eventlet (#2387)
balloob Jun 30, 2016
21be4c1
Add Sonos unjoin functionality (#2379)
lwis Jun 30, 2016
d0b1619
Merge remote-tracking branch 'refs/remotes/home-assistant/dev' into H…
pvizeli Jun 30, 2016
d326d18
fix bug in event handling and add cast for watersensor
pvizeli Jun 30, 2016
d67f79e
remove unused pylint exeption
pvizeli Jun 30, 2016
a57cd58
Merge pull request #2399 from pvizeli/Homematic_fix
pvizeli Jun 30, 2016
952b1a3
kodi platform: following jsonrpc-request version bump (0.3), let kodi…
Jun 30, 2016
c44eefa
Version bump to 0.23.0
balloob Jul 1, 2016
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
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ omit =
homeassistant/components/ecobee.py
homeassistant/components/*/ecobee.py

homeassistant/components/envisalink.py
homeassistant/components/*/envisalink.py

homeassistant/components/insteon_hub.py
homeassistant/components/*/insteon_hub.py

Expand Down Expand Up @@ -81,6 +84,9 @@ omit =
homeassistant/components/netatmo.py
homeassistant/components/*/netatmo.py

homeassistant/components/homematic.py
homeassistant/components/*/homematic.py

homeassistant/components/alarm_control_panel/alarmdotcom.py
homeassistant/components/alarm_control_panel/nx584.py
homeassistant/components/binary_sensor/arest.py
Expand Down Expand Up @@ -111,6 +117,8 @@ omit =
homeassistant/components/downloader.py
homeassistant/components/feedreader.py
homeassistant/components/garage_door/wink.py
homeassistant/components/garage_door/rpi_gpio.py
homeassistant/components/hdmi_cec.py
homeassistant/components/ifttt.py
homeassistant/components/keyboard.py
homeassistant/components/light/blinksticklight.py
Expand All @@ -120,7 +128,9 @@ omit =
homeassistant/components/light/limitlessled.py
homeassistant/components/light/osramlightify.py
homeassistant/components/lirc.py
homeassistant/components/media_player/braviatv.py
homeassistant/components/media_player/cast.py
homeassistant/components/media_player/cmus.py
homeassistant/components/media_player/denon.py
homeassistant/components/media_player/firetv.py
homeassistant/components/media_player/gpmdp.py
Expand Down Expand Up @@ -170,6 +180,7 @@ omit =
homeassistant/components/sensor/efergy.py
homeassistant/components/sensor/eliqonline.py
homeassistant/components/sensor/fitbit.py
homeassistant/components/sensor/fixer.py
homeassistant/components/sensor/forecast.py
homeassistant/components/sensor/glances.py
homeassistant/components/sensor/google_travel_time.py
Expand All @@ -180,6 +191,7 @@ omit =
homeassistant/components/sensor/nzbget.py
homeassistant/components/sensor/onewire.py
homeassistant/components/sensor/openweathermap.py
homeassistant/components/sensor/openexchangerates.py
homeassistant/components/sensor/plex.py
homeassistant/components/sensor/rest.py
homeassistant/components/sensor/sabnzbd.py
Expand Down
3 changes: 3 additions & 0 deletions config/configuration.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ http:
# Set to 1 to enable development mode
# development: 1

frontend:
# enable the frontend

light:
# platform: hue

Expand Down
133 changes: 16 additions & 117 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,23 @@
import logging
import logging.handlers
import os
import shutil
import sys
from collections import defaultdict
from threading import RLock

import voluptuous as vol

import homeassistant.components as core_components
import homeassistant.components.group as group
import homeassistant.config as config_util
from homeassistant.components import group, persistent_notification
import homeassistant.config as conf_util
import homeassistant.core as core
import homeassistant.helpers.config_validation as cv
import homeassistant.loader as loader
import homeassistant.util.dt as date_util
import homeassistant.util.location as loc_util
import homeassistant.util.package as pkg_util
from homeassistant.const import (
CONF_CUSTOMIZE, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME,
CONF_TEMPERATURE_UNIT, CONF_TIME_ZONE, EVENT_COMPONENT_LOADED,
TEMP_CELSIUS, TEMP_FAHRENHEIT, PLATFORM_FORMAT, __version__)
from homeassistant.const import EVENT_COMPONENT_LOADED, PLATFORM_FORMAT
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import (
event_decorators, service, config_per_platform, extract_domain_configs)
from homeassistant.helpers.entity import Entity

_LOGGER = logging.getLogger(__name__)
_SETUP_LOCK = RLock()
Expand Down Expand Up @@ -208,11 +201,6 @@ def prepare_setup_platform(hass, config, domain, platform_name):
return platform


def mount_local_lib_path(config_dir):
"""Add local library to Python Path."""
sys.path.insert(0, os.path.join(config_dir, 'deps'))


# pylint: disable=too-many-branches, too-many-statements, too-many-arguments
def from_config_dict(config, hass=None, config_dir=None, enable_log=True,
verbose=False, skip_pip=False,
Expand All @@ -226,18 +214,17 @@ def from_config_dict(config, hass=None, config_dir=None, enable_log=True,
if config_dir is not None:
config_dir = os.path.abspath(config_dir)
hass.config.config_dir = config_dir
mount_local_lib_path(config_dir)
_mount_local_lib_path(config_dir)

core_config = config.get(core.DOMAIN, {})

try:
process_ha_core_config(hass, config_util.CORE_CONFIG_SCHEMA(
core_config))
except vol.MultipleInvalid as ex:
conf_util.process_ha_core_config(hass, core_config)
except vol.Invalid as ex:
cv.log_exception(_LOGGER, ex, 'homeassistant', core_config)
return None

process_ha_config_upgrade(hass)
conf_util.process_ha_config_upgrade(hass)

if enable_log:
enable_logging(hass, verbose, log_rotate_days)
Expand All @@ -262,9 +249,10 @@ def from_config_dict(config, hass=None, config_dir=None, enable_log=True,
if not core_components.setup(hass, config):
_LOGGER.error('Home Assistant core failed to initialize. '
'Further initialization aborted.')

return hass

persistent_notification.setup(hass, config)

_LOGGER.info('Home Assistant core initialized')

# Give event decorators access to HASS
Expand All @@ -291,12 +279,12 @@ def from_config_file(config_path, hass=None, verbose=False, skip_pip=True,
# Set config dir to directory holding config file
config_dir = os.path.abspath(os.path.dirname(config_path))
hass.config.config_dir = config_dir
mount_local_lib_path(config_dir)
_mount_local_lib_path(config_dir)

enable_logging(hass, verbose, log_rotate_days)

try:
config_dict = config_util.load_yaml_config_file(config_path)
config_dict = conf_util.load_yaml_config_file(config_path)
except HomeAssistantError:
return None

Expand Down Expand Up @@ -355,101 +343,12 @@ def enable_logging(hass, verbose=False, log_rotate_days=None):
'Unable to setup error log %s (access denied)', err_log_path)


def process_ha_config_upgrade(hass):
"""Upgrade config if necessary."""
version_path = hass.config.path('.HA_VERSION')

try:
with open(version_path, 'rt') as inp:
conf_version = inp.readline().strip()
except FileNotFoundError:
# Last version to not have this file
conf_version = '0.7.7'

if conf_version == __version__:
return

_LOGGER.info('Upgrading config directory from %s to %s', conf_version,
__version__)

# This was where dependencies were installed before v0.18
# Probably should keep this around until ~v0.20.
lib_path = hass.config.path('lib')
if os.path.isdir(lib_path):
shutil.rmtree(lib_path)

lib_path = hass.config.path('deps')
if os.path.isdir(lib_path):
shutil.rmtree(lib_path)

with open(version_path, 'wt') as outp:
outp.write(__version__)


def process_ha_core_config(hass, config):
"""Process the [homeassistant] section from the config."""
hac = hass.config

def set_time_zone(time_zone_str):
"""Helper method to set time zone."""
if time_zone_str is None:
return

time_zone = date_util.get_time_zone(time_zone_str)

if time_zone:
hac.time_zone = time_zone
date_util.set_default_time_zone(time_zone)
else:
_LOGGER.error('Received invalid time zone %s', time_zone_str)

for key, attr in ((CONF_LATITUDE, 'latitude'),
(CONF_LONGITUDE, 'longitude'),
(CONF_NAME, 'location_name')):
if key in config:
setattr(hac, attr, config[key])

if CONF_TIME_ZONE in config:
set_time_zone(config.get(CONF_TIME_ZONE))

for entity_id, attrs in config.get(CONF_CUSTOMIZE).items():
Entity.overwrite_attribute(entity_id, attrs.keys(), attrs.values())

if CONF_TEMPERATURE_UNIT in config:
hac.temperature_unit = config[CONF_TEMPERATURE_UNIT]

# If we miss some of the needed values, auto detect them
if None not in (
hac.latitude, hac.longitude, hac.temperature_unit, hac.time_zone):
return

_LOGGER.warning('Incomplete core config. Auto detecting location and '
'temperature unit')

info = loc_util.detect_location_info()

if info is None:
_LOGGER.error('Could not detect location information')
return

if hac.latitude is None and hac.longitude is None:
hac.latitude = info.latitude
hac.longitude = info.longitude

if hac.temperature_unit is None:
if info.use_fahrenheit:
hac.temperature_unit = TEMP_FAHRENHEIT
else:
hac.temperature_unit = TEMP_CELSIUS

if hac.location_name is None:
hac.location_name = info.city

if hac.time_zone is None:
set_time_zone(info.time_zone)


def _ensure_loader_prepared(hass):
"""Ensure Home Assistant loader is prepared."""
if not loader.PREPARED:
loader.prepare(hass)


def _mount_local_lib_path(config_dir):
"""Add local library to Python Path."""
sys.path.insert(0, os.path.join(config_dir, 'deps'))
24 changes: 24 additions & 0 deletions homeassistant/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

_LOGGER = logging.getLogger(__name__)

SERVICE_RELOAD_CORE_CONFIG = 'reload_core_config'


def is_on(hass, entity_id=None):
"""Load up the module to call the is_on method.
Expand Down Expand Up @@ -73,6 +75,11 @@ def toggle(hass, entity_id=None, **service_data):
hass.services.call(ha.DOMAIN, SERVICE_TOGGLE, service_data)


def reload_core_config(hass):
"""Reload the core config."""
hass.services.call(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG)


def setup(hass, config):
"""Setup general services related to Home Assistant."""
def handle_turn_service(service):
Expand Down Expand Up @@ -111,4 +118,21 @@ def handle_turn_service(service):
hass.services.register(ha.DOMAIN, SERVICE_TURN_ON, handle_turn_service)
hass.services.register(ha.DOMAIN, SERVICE_TOGGLE, handle_turn_service)

def handle_reload_config(call):
"""Service handler for reloading core config."""
from homeassistant.exceptions import HomeAssistantError
from homeassistant import config as conf_util

try:
path = conf_util.find_config_file(hass.config.config_dir)
conf = conf_util.load_yaml_config_file(path)
except HomeAssistantError as err:
_LOGGER.error(err)
return

conf_util.process_ha_core_config(hass, conf.get(ha.DOMAIN) or {})

hass.services.register(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG,
handle_reload_config)

return True
Loading