Skip to content

Commit d749fca

Browse files
committed
[Fix] Getting url for camera access when not on lan
1 parent f8ee74b commit d749fca

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lnetatmo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,12 @@ def cameraUrls(self, camera=None, home=None, cid=None):
550550
vpn_url = camera_data['vpn_url']
551551
resp = postRequest(vpn_url + '/command/ping')
552552
temp_local_url=resp['local_url']
553-
resp = postRequest(temp_local_url + '/command/ping',timeout=1)
554-
if resp and temp_local_url == resp['local_url']:
555-
local_url = temp_local_url
553+
try:
554+
resp = postRequest(temp_local_url + '/command/ping',timeout=1)
555+
if resp and temp_local_url == resp['local_url']:
556+
local_url = temp_local_url
557+
except: # On this particular request, vithout errors from previous requests, error is timeout
558+
local_url = None
556559
return vpn_url, local_url
557560

558561
def url(self, camera=None, home=None, cid=None):

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='lnetatmo',
7-
version='1.6.0',
7+
version='1.6.1',
88
classifiers=[
99
'Development Status :: 5 - Production/Stable',
1010
'Intended Audience :: Developers',
@@ -17,7 +17,7 @@
1717
scripts=[],
1818
data_files=[],
1919
url='https://github.com/philippelt/netatmo-api-python',
20-
download_url='https://github.com/philippelt/netatmo-api-python/tarball/v1.6.0.tar.gz',
20+
download_url='https://github.com/philippelt/netatmo-api-python/tarball/v1.6.1.tar.gz',
2121
license='GPL V3',
2222
description='Simple API to access Netatmo weather station data from any python script.'
2323
)

0 commit comments

Comments
 (0)