* specify rtsp_transport for onvif camera
* remove used variable
* Update homeassistant/components/stream/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* change options to stream_options
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Adding support for PTZ move modes
Adding support for other PTZ move modes.
Onvif intergration used to only support RelativeMove where it should also supports AbsoluteMove, ContinuousMove and Stop.
For exemple Goke GK7102 based IP camera only support ContinuousMove mode.
This commit add those new modes with avaibility to select mode and params in service call.
* Adding support for PTZ move modes
Adding support for other PTZ move modes.
Onvif intergration used to only support RelativeMove where it should also supports AbsoluteMove, ContinuousMove and Stop.
For exemple Goke GK7102 based IP camera only support ContinuousMove mode.
Update service helper for new avaibility to select mode and params in service call.
* RelativeMode as default move_mode to avoid breakchange
RelativeMode as default move_mode to avoid breakchange
* add missing attribute
add missing continuous_duration attribute
* change service attribute label for continuous_duration
* update description
fix wrong assertion for move_mode attr description
* Update services.yaml
* Update services.yaml
fix wrong wording for move_mode
* Update camera.py
Using defined constants instead of raw strings in conditions
* Update camera.py
Replace integer to floating point in logger debug PTZ values
* Update services.yaml
* Update services.yaml
* Update camera.py
* Update camera.py
* use dict[key] for required schema keys and keys with default schema values
* remove async for setup_ptz method
* lint error
* remove unecessary PTZ_NONE = "NONE"
changed request by @MartinHjelmare
* addressing @ MartinHjelmare comments
- Remove None in defaluts and dicts
- Replace long if blocks
* remove NONE
* lint issue
* Update camera.py
* Fix lint error - typo
* rename onvif_ptz service to just ptz
* rename onvif_ptz service to just ptz
* use dict[key] when default values are set
use service.data[key] instead of service.data.get[key] when default value is set in service schema
* adresse comment: use dict[key] for pan tilt zoom
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Fix Onvif setup error with a premature end of connection on GetStreamUri wsdl call
Reconnect to onvif camera after getting profiles to fix this error :
[homeassistant.components.onvif.camera] Retrieving stream uri
[zeep.asyncio.transport] HTTP Post to http://192.168.1.15/onvif/Media:
b'<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
2019-09-20 01:08:51 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform onvif
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 553, in write_bytes
await self.body.write(writer)
File "/usr/local/lib/python3.7/site-packages/aiohttp/payload.py", line 231, in write
await writer.write(self._value)
File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 101, in write
self._write(chunk)
File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 110, in async_setup_platform
await hass_camera.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 168, in async_initialize
await self.async_obtain_input_uri()
File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 266, in async_obtain_input_uri
stream_uri = await media_service.GetStreamUri(req)
File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/bindings.py", line 13, in send
options["address"], envelope, http_headers
File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 107, in post_xml
response = await self.post(address, message, headers)
File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 95, in post
proxy=self.proxy,
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request
await resp.start(conn)
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read
await self._waiter
aiohttp.client_exceptions.ClientOSError: [Errno None] Can not write request body for http://192.168.1.15/onvif/Media
* Add code comment
* Update camera.py
* Lint.
* Onvif camera improvements using zeep
* Fix static code checks
* Make obtain_input_uri async
* Convert several methods to async
* Fix static checks
* Fix static checks
* Fix requirements_all.txt
* Lint improvements
* Async services
* Use onvif-zeep-async and check if PTZ service is available before creating it
* Remove some hacks that are now defined in onvif-zeep-async
* Don't log input, it might contain sensitive information
* Static code analysis fixes
* Run requirements stuff
* Fix
* Remove suds requirement
* Onvif camera improvements using zeep
* Fix static code checks
* Make obtain_input_uri async
* Convert several methods to async
* Fix static checks
* Fix static checks
* Fix requirements_all.txt
* Lint improvements
* Async services
* Use onvif-zeep-async and check if PTZ service is available before creating it
* Remove some hacks that are now defined in onvif-zeep-async
* Don't log input, it might contain sensitive information
* Static code analysis fixes
* Run requirements stuff
* Fix
* Remove suds requirement
* Use dt_util.utcnow
* Platform setup should not have a return value
* Remove explicit dependency to zeep[async]
* Bump onvif-zeep-async to 0.1.2
* Update requirements_all.txt
* Add exception handling
* Fix static checks
* Don't catch generic exceptions
* Update camera.py
* Load dependencies from manifests. Fallback to current DEPENDENCIES
* Fix typing
* Ignore typing correctly
* Split out dependency processing to a new method
* Fix tests
* Only pull from manifest if dependencies is non empty
* Inline temporary function
* Fix light tests [skip ci]
* Fix tests/common
* Fix some mqtt tests [skip ci]
* Fix tests and component manifests which have only one platform
* Fix rflink tests
* Fix more tests and manifests
* Readability over shorthand format
* Fix demo/notify tests
* Load dependencies from manifests. Fallback to current DEPENDENCIES
* Load requirements from manifests. Fallback to current REQUIREMENTS
* Fix typing
* Ignore typing correctly
* Split out dependency processing to a new method
* Only pull from manifest if dependencies is non empty
* Inline temporary function
* Fix tests and component manifests which have only one platform
* Fix rflink tests
* Readability over shorthand format
* Clean up requirements
* Use integration to resolve deps/reqs
* Lint
* Lint
* revert a change
* Revert a test change
* Fix types
* Fix types
* Add back cache for load component
* Fix test_component_not_found
* Move light.test and device_tracker.test into test package instead with manifest to fix tests
* Fix broken device_tracker tests
* Add docstrings to __init__
* Fix all of the light tests that I broke earlier
* Embed the test.switch platform to fix other tests
* Embed and fix the test.imagimage_processing platform
* Fix tests for nx584
* Add dependencies from platform file's DEPENDENCIES
* Try to setup component when entity_platform is setting up
Fix tests in helpers folder
* Rewrite test_setup
* Simplify
* Lint
* Disable demo component if running in test
Temp workaround to unblock CI tests
* Skip demo tests
* Fix config entry test
* Fix repeat test
* Clarify doc
* One extra guard
* Fix import
* Lint
* Workaround google tts
* Update Onvif component to SUPPORT_STREAM
* Update camera.py
* Update camera.py
* Update camera.py
Remove extra spaces.
* lookup URL when camera is added to hass and add extra guards
* initial commit for camera preferences and preload stream
* cleanup and add tests
* respect camera preferences on each request stream call
* return the new prefs after update
* Consolidate
* Fix tests
* Update imports
* Fix import
* Use importlib because integration and package share name
* Fix more tests
* Update .coveragerc and CODEOWNERS