Log error for servicecall without required data

* Log error for services called without required attributes, in
	media_player, notify and thermostat platforms.
* Add fan property and methods in thermostat demo component.
* Add tests for notify file and thermostat demo component.
* Increase coverage of tests for media_player, notify and thermostat
	platforms.
* Fix some PEP issues, but not all. Tests still have old linting
	errors.
This commit is contained in:
MartinHjelmare committed 2016-03-19 08:06:57 +01:00
1 parent 72fdd94b29
commit 4e4b24fcff
14 files changed
+489 -90

No files matched your search

@@ -71,6 +71,9 @@ def setup(hass, config):
message = call.data.get(ATTR_MESSAGE)
if message is None:
_LOGGER.error(
'Received call to %s without attribute %s',
call.service, ATTR_MESSAGE)
return
title = template.render(
+1 -1
View File
@@ -45,7 +45,7 @@ class FileNotificationService(BaseNotificationService):
title = '{} notifications (Log started: {})\n{}\n'.format(
kwargs.get(ATTR_TITLE),
dt_util.strip_microseconds(dt_util.utcnow()),
'-'*80)
'-' * 80)
file.write(title)
if self.add_timestamp == 1: