Compare commits

...

10 Commits

Author SHA1 Message Date
Paulus Schoutsen bd71a33ba8 Merge pull request #9196 from home-assistant/release-0-52-1
0.52.1
2017-08-28 09:22:00 -07:00
Nolan Gilley 0ccff6c03e bump ecobee version to fix issue 9190 (#9191) 2017-08-28 09:15:34 -07:00
mjj4791 3509ecf07f Prevent iCloud exceptions in logfile (#9179)
* Prevent iCloud exceptions in logfile

With this change ValueError exceptions in the logfile caused by this component will disappear.
These errors are caused by the iCloud API returning an HTTP 450 error and the external lib throwing a ValueError because of it.

A PR has been raised against the external library, but that fix did not yet make it into a new version of the library. This will catch the exception in the mean time.... https://github.com/picklepete/pyicloud/pull/138

* Align log messages
2017-08-28 09:15:34 -07:00
Paulus Schoutsen 308b822832 Wrap state when iterating a domain in templates (#9157) 2017-08-28 09:15:34 -07:00
Adam Mills d986b8f4c2 Bump aioautomatic to prevent leaking exceptions (#9148) 2017-08-28 09:15:33 -07:00
Sean Dague e6892a4077 Fix import for foscam (#9140)
While waiting for a new pyfoscam release, we can fix this for users
just by changing the import. Foscam devices a pretty widely deployed,
so a regression here is definitely no fun.

Fixes Bug #8940
2017-08-28 09:15:33 -07:00
Daniel Høyer Iversen 422be25d22 bug fix pushbullet (#9139) 2017-08-28 09:15:33 -07:00
Daniel Høyer Iversen 0ae1f85f9f Fix issue #9116 in pushbullet (#9128)
* Fix issue #9116 in pushbullet
2017-08-28 09:15:32 -07:00
Andrey Kupreychik 8a89643338 Close stream request once we end up with proxy (#9110)
* Close stream request once we end up with proxy

* Update aiohttp_client.py

* Update aiohttp_client.py

* Removed trailing whitespace
2017-08-28 09:15:32 -07:00
Paulus Schoutsen 10e3c00f07 Version bump to 0.52.1 2017-08-28 09:11:11 -07:00
10 changed files with 55 additions and 38 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ class FoscamCam(Camera):
self._name = device_info.get(CONF_NAME)
self._motion_status = False
from foscam import FoscamCamera
from foscam.foscam import FoscamCamera
self._foscam_session = FoscamCamera(ip_address, port, self._username,
self._password, verbose=False)
@@ -23,7 +23,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_time_interval
REQUIREMENTS = ['aioautomatic==0.6.0']
REQUIREMENTS = ['aioautomatic==0.6.2']
DEPENDENCIES = ['http']
_LOGGER = logging.getLogger(__name__)
@@ -307,12 +307,15 @@ class Icloud(DeviceScanner):
self.api.authenticate()
currentminutes = dt_util.now().hour * 60 + dt_util.now().minute
for devicename in self.devices:
interval = self._intervals.get(devicename, 1)
if ((currentminutes % interval == 0) or
(interval > 10 and
currentminutes % interval in [2, 4])):
self.update_device(devicename)
try:
for devicename in self.devices:
interval = self._intervals.get(devicename, 1)
if ((currentminutes % interval == 0) or
(interval > 10 and
currentminutes % interval in [2, 4])):
self.update_device(devicename)
except ValueError:
_LOGGER.debug("iCloud API returned an error")
def determine_interval(self, devicename, latitude, longitude, battery):
"""Calculate new interval."""
@@ -397,7 +400,7 @@ class Icloud(DeviceScanner):
self.see(**kwargs)
self.seen_devices[devicename] = True
except PyiCloudNoDevicesException:
_LOGGER.error('No iCloud Devices found!')
_LOGGER.error("No iCloud Devices found")
def lost_iphone(self, devicename):
"""Call the lost iPhone function if the device is found."""
+1 -1
View File
@@ -15,7 +15,7 @@ from homeassistant.helpers import discovery
from homeassistant.const import CONF_API_KEY
from homeassistant.util import Throttle
REQUIREMENTS = ['python-ecobee-api==0.0.8']
REQUIREMENTS = ['python-ecobee-api==0.0.9']
_CONFIGURING = {}
_LOGGER = logging.getLogger(__name__)
+28 -21
View File
@@ -89,7 +89,7 @@ class PushBulletNotificationService(BaseNotificationService):
if not targets:
# Backward compatibility, notify all devices in own account
self._push_data(filepath, message, title, url)
self._push_data(filepath, message, title, self.pushbullet, url)
_LOGGER.info("Sent notification to self")
return
@@ -104,7 +104,8 @@ class PushBulletNotificationService(BaseNotificationService):
# Target is email, send directly, don't use a target object
# This also seems works to send to all devices in own account
if ttype == 'email':
self._push_data(filepath, message, title, url, tname)
self._push_data(filepath, message, title, url,
self.pushbullet, tname)
_LOGGER.info("Sent notification to email %s", tname)
continue
@@ -123,27 +124,33 @@ class PushBulletNotificationService(BaseNotificationService):
# Attempt push_note on a dict value. Keys are types & target
# name. Dict pbtargets has all *actual* targets.
try:
if url:
self.pbtargets[ttype][tname].push_link(
title, url, body=message)
else:
self.pbtargets[ttype][tname].push_note(title, message)
self._push_data(filepath, message, title, url,
self.pbtargets[ttype][tname])
_LOGGER.info("Sent notification to %s/%s", ttype, tname)
except KeyError:
_LOGGER.error("No such target: %s/%s", ttype, tname)
continue
except self.pushbullet.errors.PushError:
_LOGGER.error("Notify failed to: %s/%s", ttype, tname)
continue
def _push_data(self, filepath, message, title, url, tname=None):
if url:
self.pushbullet.push_link(
title, url, body=message, email=tname)
elif filepath and self.hass.config.is_allowed_path(filepath):
with open(filepath, "rb") as fileh:
filedata = self.pushbullet.upload_file(fileh, filepath)
self.pushbullet.push_file(title=title, body=message,
**filedata)
else:
self.pushbullet.push_note(title, message, email=tname)
def _push_data(self, filepath, message, title, url, pusher, tname=None):
from pushbullet import PushError
from pushbullet import Device
try:
if url:
if isinstance(pusher, Device):
pusher.push_link(title, url, body=message)
else:
pusher.push_link(title, url, body=message, email=tname)
elif filepath and self.hass.config.is_allowed_path(filepath):
with open(filepath, "rb") as fileh:
filedata = self.pushbullet.upload_file(fileh, filepath)
if filedata.get('file_type') == 'application/x-empty':
_LOGGER.error("Failed to send an empty file.")
return
pusher.push_file(title=title, body=message, **filedata)
else:
if isinstance(pusher, Device):
pusher.push_note(title, message)
else:
pusher.push_note(title, message, email=tname)
except PushError as err:
_LOGGER.error("Notify failed: %s", err)
+1 -1
View File
@@ -2,7 +2,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 52
PATCH_VERSION = '0'
PATCH_VERSION = '1'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 4, 2)
+9 -2
View File
@@ -90,8 +90,15 @@ def async_aiohttp_proxy_web(hass, request, web_coro, buffer_size=102400,
# Something went wrong with the connection
raise HTTPBadGateway() from err
yield from async_aiohttp_proxy_stream(hass, request, req.content,
req.headers.get(CONTENT_TYPE))
try:
yield from async_aiohttp_proxy_stream(
hass,
request,
req.content,
req.headers.get(CONTENT_TYPE)
)
finally:
req.close()
@asyncio.coroutine
+1 -1
View File
@@ -209,7 +209,7 @@ class DomainStates(object):
def __iter__(self):
"""Return the iteration over all the states."""
return iter(sorted(
(state for state in self._hass.states.async_all()
(_wrap_state(state) for state in self._hass.states.async_all()
if state.domain == self._domain),
key=lambda state: state.entity_id))
+2 -2
View File
@@ -42,7 +42,7 @@ TwitterAPI==2.4.6
abodepy==0.7.1
# homeassistant.components.device_tracker.automatic
aioautomatic==0.6.0
aioautomatic==0.6.2
# homeassistant.components.sensor.dnsip
aiodns==1.1.1
@@ -716,7 +716,7 @@ python-clementine-remote==1.0.1
python-digitalocean==1.12
# homeassistant.components.ecobee
python-ecobee-api==0.0.8
python-ecobee-api==0.0.9
# homeassistant.components.climate.eq3btsmart
# python-eq3bt==0.1.5
+1 -1
View File
@@ -27,7 +27,7 @@ PyJWT==1.5.2
SoCo==0.12
# homeassistant.components.device_tracker.automatic
aioautomatic==0.6.0
aioautomatic==0.6.2
# homeassistant.components.emulated_hue
# homeassistant.components.http