8000 Synology SSL fix & Error handling by pvizeli · Pull Request #4325 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Synology SSL fix & Error handling #4325

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

Merged
merged 10 commits into from
Nov 11, 2016
Merged

Conversation

pvizeli
Copy link
Member
@pvizeli pvizeli commented Nov 9, 2016

Description:

Enable the old stuff to disable the ssl verifycation back.

@balloob I think this platform has to many device specifying code inside. Wrapped in a API it would more readable...

Related issue (if applicable): #4296 #4257

CC @jgriff2

@mention-bot
Copy link

@pvizeli, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob and @jgriff2 to be potential reviewers.

EVENT_HOMEASSISTANT_STOP, _async_close_synlogy_websession)

websession = hass.data.get(DATA_WEBSESSION)
else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

farcy v1.1

  • 10: E999 SyntaxError: invalid syntax


websession = hass.data.get(DATA_WEBSESSION)
else
websession = hass.websession

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

farcy v1.1

  • 9: E113 unexpected indentation

@pvizeli
Copy link
Member Author
pvizeli commented Nov 10, 2016

Can any one with synology test that? @jgriff2

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 143, in _async_setup_platform
entity_platform.async_add_entities, discovery_info
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/synology.py", line 141, in async_setup_platform
cookies={'id': session_id}
File "/usr/local/lib/python3.4/dist-packages/aiohttp/client.py", line 403, in get
**kwargs))
TypeError: _request() got an unexpected keyword argument 'cookies'

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

You can't pass cookies as an argument to aiohttp.ClientSession.get()

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Line 64 should also be an if not instead of if

@pvizeli
Copy link
Member Author
pvizeli commented Nov 10, 2016

Yeah, I need to change to generic request function and stay only the connector to data

@pvizeli
Copy link
Member Author
pvizeli commented Nov 10, 2016

@jgriff2 please a new test

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 143, in _async_setup_platform
entity_platform.async_add_entities, discovery_info
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/synology.py", line 117, in async_setup_platform
syno_auth_url
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/synology.py", line 195, in get_session_id
with async_timeout.timeout(TIMEOUT, loop=hass.loop):
NameError: name 'hass' is not defined

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Please also change line 62 from if to if not

@pvizeli
Copy link
Member Author
pvizeli commented Nov 10, 2016

@jgriff2 try agen 👍

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 143, in _async_setup_platform
entity_platform.async_add_entities, discovery_info
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/synology.py", line 147, in async_setup_platform
params=camera_payload,
File "/usr/local/lib/python3.4/dist-packages/aiohttp/client.py", line 555, in iter
resp = yield from self._coro
File "/usr/local/lib/python3.4/dist-packages/aiohttp/client.py", line 161, in _request
raise RuntimeError('Session is closed')
RuntimeError: Session is closed

@pvizeli
Copy link
Member Author
pvizeli commented Nov 10, 2016

@jgriff2 fixed

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Camera loads now and you get the preview on the main page. If you click and try to get streaming video you get this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/aiohttp/server.py", line 261, in start
yield from self.handle_request(message, payload)
File "/usr/local/lib/python3.4/dist-packages/aiohttp/web.py", line 88, in handle_request
resp = yield from handler(request)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/http.py", line 495, in handle
result = yield from result
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/init.py", line 187, in get
response = yield from self.handle(request, camera)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/init.py", line 222, in handle
yield from camera.handle_async_mjpeg_stream(request)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/camera/synology.py", line 278, in handle_async_mjpeg_stream
payload=streaming_payload
File "/usr/local/lib/python3.4/dist-packages/aiohttp/client.py", line 403, in get
**kwargs))
TypeError: _request() got an unexpected keyword argument 'payload'

@pvizeli
Copy link
Member Author
pvizeli commented Nov 10, 2016

that is also fixed @jgriff2

@jgriff2
Copy link
Contributor
jgriff2 commented Nov 10, 2016

Looks good.

@balloob balloob added this to the 0.32.3 milestone Nov 11, 2016
@balloob balloob merged commit 844799a into home-assistant:dev Nov 11, 2016
balloob pushed a commit that referenced this pull request Nov 11, 2016
* Synology SSL fix & Error handling

* change handling for cookies/ssl

* fix use not deprecated functions

* fix lint

* change verify

* fix connector close to coro

* fix force close

* not needed since websession close connector too

* fix params

* fix lint
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0