WIP: Refactor Axis component removing external dependencies (#9791)
* Async rewrite * Device and events now working with async core * More async than before * Methods have moved * Remove check if parameter serial number is available since library handles reconnection anyway and we can expect user to set up configuration correctly * Async rewrite * Device and events now working with async core * More async than before * Methods have moved * Remove check if parameter serial number is available since library handles reconnection anyway and we can expect user to set up configuration correctly * Serial number is the only unique identifier, checks are still needed * No async for setup_device * Bump axis to 13 in preparation of friday the 13th * Fix review comments * Removed async after some discussions with @armills. It wasn't possible to get past that aiohttp doesnt support digest auth, which makes it impossible to convert the full library at this point in time.
This commit is contained in:
1 parent
e8f5445acc
commit
34368a6b69
4 files changed
+62
-112
No files matched your search
@@ -11,7 +11,7 @@ from homeassistant.const import (
|
||||
CONF_AUTHENTICATION, HTTP_DIGEST_AUTHENTICATION)
|
||||
from homeassistant.components.camera.mjpeg import (
|
||||
CONF_MJPEG_URL, CONF_STILL_IMAGE_URL, MjpegCamera)
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.dispatcher import dispatcher_connect
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -52,9 +52,9 @@ class AxisCamera(MjpegCamera):
|
||||
"""Initialize Axis Communications camera component."""
|
||||
super().__init__(hass, config)
|
||||
self.port = port
|
||||
async_dispatcher_connect(hass,
|
||||
DOMAIN + '_' + config[CONF_NAME] + '_new_ip',
|
||||
self._new_ip)
|
||||
dispatcher_connect(hass,
|
||||
DOMAIN + '_' + config[CONF_NAME] + '_new_ip',
|
||||
self._new_ip)
|
||||
|
||||
def _new_ip(self, host):
|
||||
"""Set new IP for video stream."""
|
||||
|
||||
Reference in new issue
Block a user