Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7307ab8
Bump pywebpush and pyJWT versions (#9355)
fanaticDavid Sep 10, 2017
e2fc966
Add /usr/sbin to PATH (#9364)
morberg Sep 11, 2017
cc19796
Add polling interval service and setting available through zwave node…
turbokongen Sep 11, 2017
c7ecebf
Round off probability to 2 decimals. (#9365)
arsaboo Sep 11, 2017
31f189d
Added mqtt_statestream component (#9286)
mw-white Sep 11, 2017
6d01838
Fixes #9379 - Added additional string check in Wunderground sensor (#…
arsaboo Sep 11, 2017
51ff600
typo in waypoint import topic preventing waypoint import (#9338)
diplix Sep 11, 2017
10c0744
Fixes #9353 (#9354)
MikeChristianson Sep 12, 2017
659dc2e
Fixing foscam library dependency/requirements (#9387)
viswa-swami Sep 12, 2017
c84a099
Update frontend
balloob Sep 12, 2017
90f9a6b
Cleanup and simplitfy the async state update (#9390)
pvizeli Sep 12, 2017
c9fc3fa
Update cloud auth (#9357)
balloob Sep 12, 2017
29b62f8
Allow multiple observations of same entity (#9391)
jlmcgehee21 Sep 12, 2017
05192e6
Break up Alexa per functionality (#9400)
balloob Sep 12, 2017
fdf2d24
Upgrade psutil to 5.3.1 (#9403)
fabaff Sep 12, 2017
c8da95c
fix mopar sensor (#9389)
happyleavesaoc Sep 13, 2017
f5ffef3
Support specifying no Apple TVs (#9394)
postlund Sep 13, 2017
2c8967d
Update netdisco to 1.2.0 (#9408)
balloob Sep 13, 2017
d90801f
components/xiaomi: Add initial discovery using NetDisco. (#9283)
pfalcon Sep 13, 2017
89d6784
Fix copy&paste mistake (#9378)
tinloaf Sep 13, 2017
411c962
Added log-file command line flag (#9422)
TD22057 Sep 14, 2017
b21bfe5
Add LC_CTYPE to environment variables in macOS (#9227)
morberg Sep 14, 2017
5b453ca
Added more devices and types to onewire (#9404)
tcastberg Sep 14, 2017
07cb7b3
Bump uvcclient to 0.10.1 to work with beta NVR releases (#9423)
antonym Sep 14, 2017
28d3128
full RGB support for users of tradfri GW (#9411)
spektren Sep 14, 2017
c94b3a7
Add support for Todoist platform (#9236)
Jay2645 Sep 14, 2017
ba5e8d1
Fix artwork bug in Apple TV (#9415)
postlund Sep 14, 2017
5db55b3
Bump python-mirobo for improved device support and introduce API chan…
syssi Sep 14, 2017
f5dee2c
MPD small improvements (#9301)
pdanilew Sep 14, 2017
3430c1c
update broadlink.py to add support for MP1 switch (#9222)
giangvo Sep 14, 2017
371d1cc
Fix displaying of friendly_name for light template component (#9413)
rollbrettler Sep 14, 2017
20f3e3d
Improve Python script (#9417)
doudz Sep 14, 2017
9c603d9
Add manual alarm_control_panel pending time per state (#9264)
snjoetw Sep 14, 2017
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 .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ omit =
homeassistant/components/binary_sensor/rest.py
homeassistant/components/binary_sensor/tapsaff.py
homeassistant/components/browser.py
homeassistant/components/calendar/todoist.py
homeassistant/components/camera/bloomsky.py
homeassistant/components/camera/ffmpeg.py
homeassistant/components/camera/foscam.py
Expand Down
11 changes: 9 additions & 2 deletions homeassistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ def get_arguments() -> argparse.Namespace:
type=int,
default=None,
help='Enables daily log rotation and keeps up to the specified days')
parser.add_argument(
'--log-file',
type=str,
default=None,
help='Log file to write to. If not set, CONFIG/home-assistant.log '
'is used')
parser.add_argument(
'--runner',
action='store_true',
Expand Down Expand Up @@ -256,13 +262,14 @@ def setup_and_run_hass(config_dir: str,
}
hass = bootstrap.from_config_dict(
config, config_dir=config_dir, verbose=args.verbose,
skip_pip=args.skip_pip, log_rotate_days=args.log_rotate_days)
skip_pip=args.skip_pip, log_rotate_days=args.log_rotate_days,
log_file=args.log_file)
else:
config_file = ensure_config_file(config_dir)
print('Config directory:', config_dir)
hass = bootstrap.from_config_file(
config_file, verbose=args.verbose, skip_pip=args.skip_pip,
log_rotate_days=args.log_rotate_days)
log_rotate_days=args.log_rotate_days, log_file=args.log_file)

if hass is None:
return None
Expand Down
31 changes: 20 additions & 11 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def from_config_dict(config: Dict[str, Any],
enable_log: bool=True,
verbose: bool=False,
skip_pip: bool=False,
log_rotate_days: Any=None) \
log_rotate_days: Any=None,
log_file: Any=None) \
-> Optional[core.HomeAssistant]:
"""Try to configure Home Assistant from a configuration dictionary.

Expand All @@ -56,7 +57,7 @@ def from_config_dict(config: Dict[str, Any],
hass = hass.loop.run_until_complete(
async_from_config_dict(
config, hass, config_dir, enable_log, verbose, skip_pip,
log_rotate_days)
log_rotate_days, log_file)
)

return hass
Expand All @@ -69,7 +70,8 @@ def async_from_config_dict(config: Dict[str, Any],
enable_log: bool=True,
verbose: bool=False,
skip_pip: bool=False,
log_rotate_days: Any=None) \
log_rotate_days: Any=None,
log_file: Any=None) \
-> Optional[core.HomeAssistant]:
"""Try to configure Home Assistant from a configuration dictionary.

Expand All @@ -88,7 +90,7 @@ def async_from_config_dict(config: Dict[str, Any],
yield from hass.async_add_job(conf_util.process_ha_config_upgrade, hass)

if enable_log:
async_enable_logging(hass, verbose, log_rotate_days)
async_enable_logging(hass, verbose, log_rotate_days, log_file)

hass.config.skip_pip = skip_pip
if skip_pip:
Expand Down Expand Up @@ -153,7 +155,8 @@ def from_config_file(config_path: str,
hass: Optional[core.HomeAssistant]=None,
verbose: bool=False,
skip_pip: bool=True,
log_rotate_days: Any=None):
log_rotate_days: Any=None,
log_file: Any=None):
"""Read the configuration file and try to start all the functionality.

Will add functionality to 'hass' parameter if given,
Expand All @@ -165,7 +168,7 @@ def from_config_file(config_path: str,
# run task
hass = hass.loop.run_until_complete(
async_from_config_file(
config_path, hass, verbose, skip_pip, log_rotate_days)
config_path, hass, verbose, skip_pip, log_rotate_days, log_file)
)

return hass
Expand All @@ -176,7 +179,8 @@ def async_from_config_file(config_path: str,
hass: core.HomeAssistant,
verbose: bool=False,
skip_pip: bool=True,
log_rotate_days: Any=None):
log_rotate_days: Any=None,
log_file: Any=None):
"""Read the configuration file and try to start all the functionality.

Will add functionality to 'hass' parameter.
Expand All @@ -187,7 +191,7 @@ def async_from_config_file(config_path: str,
hass.config.config_dir = config_dir
yield from async_mount_local_lib_path(config_dir, hass.loop)

async_enable_logging(hass, verbose, log_rotate_days)
async_enable_logging(hass, verbose, log_rotate_days, log_file)

try:
config_dict = yield from hass.async_add_job(
Expand All @@ -205,7 +209,7 @@ def async_from_config_file(config_path: str,

@core.callback
def async_enable_logging(hass: core.HomeAssistant, verbose: bool=False,
log_rotate_days=None) -> None:
log_rotate_days=None, log_file=None) -> None:
"""Set up the logging.

This method must be run in the event loop.
Expand Down Expand Up @@ -239,13 +243,18 @@ def async_enable_logging(hass: core.HomeAssistant, verbose: bool=False,
pass

# Log errors to a file if we have write access to file or config dir
err_log_path = hass.config.path(ERROR_LOG_FILENAME)
if log_file is None:
err_log_path = hass.config.path(ERROR_LOG_FILENAME)
else:
err_log_path = os.path.abspath(log_file)

err_path_exists = os.path.isfile(err_log_path)
err_dir = os.path.dirname(err_log_path)

# Check if we can write to the error log if it exists or that
# we can create files in the containing directory if not.
if (err_path_exists and os.access(err_log_path, os.W_OK)) or \
(not err_path_exists and os.access(hass.config.config_dir, os.W_OK)):
(not err_path_exists and os.access(err_dir, os.W_OK)):

if log_rotate_days:
err_handler = logging.handlers.TimedRotatingFileHandler(
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/alarm_control_panel/alarmdecoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ def _message_callback(self, message):
if message.alarm_sounding or message.fire_alarm:
if self._state != STATE_ALARM_TRIGGERED:
self._state = STATE_ALARM_TRIGGERED
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()
elif message.armed_away:
if self._state != STATE_ALARM_ARMED_AWAY:
self._state = STATE_ALARM_ARMED_AWAY
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()
elif message.armed_home:
if self._state != STATE_ALARM_ARMED_HOME:
self._state = STATE_ALARM_ARMED_HOME
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()
else:
if self._state != STATE_ALARM_DISARMED:
self._state = STATE_ALARM_DISARMED
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()

@property
def name(self):
Expand Down
18 changes: 17 additions & 1 deletion homeassistant/components/alarm_control_panel/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,26 @@
https://home-assistant.io/components/demo/
"""
import homeassistant.components.alarm_control_panel.manual as manual
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_TRIGGERED, CONF_PENDING_TIME)


def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Demo alarm control panel platform."""
add_devices([
manual.ManualAlarm(hass, 'Alarm', '1234', 5, 10, False),
manual.ManualAlarm(hass, 'Alarm', '1234', 5, 10, False, {
STATE_ALARM_ARMED_AWAY: {
CONF_PENDING_TIME: 5
},
STATE_ALARM_ARMED_HOME: {
CONF_PENDING_TIME: 5
},
STATE_ALARM_ARMED_NIGHT: {
CONF_PENDING_TIME: 5
},
STATE_ALARM_TRIGGERED: {
CONF_PENDING_TIME: 5
},
}),
])
2 changes: 1 addition & 1 deletion homeassistant/components/alarm_control_panel/envisalink.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def async_added_to_hass(self):
def _update_callback(self, partition):
"""Update Home Assistant state, if needed."""
if partition is None or int(partition) == self._partition_number:
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()

@property
def code_format(self):
Expand Down
Loading