From 19514ea500c444d11ed05879c7da734b16143d2a Mon Sep 17 00:00:00 2001 From: Rohan Kapoor <rohan@rohankapoor.com> Date: Sat, 15 Sep 2018 02:26:29 -0700 Subject: [PATCH] Clean up MjpegCamera by removing unnused hass object in __init__ (#16628) --- homeassistant/components/camera/axis.py | 2 +- homeassistant/components/camera/mjpeg.py | 4 ++-- homeassistant/components/camera/zoneminder.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/camera/axis.py b/homeassistant/components/camera/axis.py index 5630759a7f8..4227cca7e2f 100644 --- a/homeassistant/components/camera/axis.py +++ b/homeassistant/components/camera/axis.py @@ -50,7 +50,7 @@ class AxisCamera(MjpegCamera): def __init__(self, hass, config, port): """Initialize Axis Communications camera component.""" - super().__init__(hass, config) + super().__init__(config) self.port = port dispatcher_connect( hass, DOMAIN + '_' + config[CONF_NAME] + '_new_ip', self._new_ip) diff --git a/homeassistant/components/camera/mjpeg.py b/homeassistant/components/camera/mjpeg.py index ed7d58658ed..f1917aaf23e 100644 --- a/homeassistant/components/camera/mjpeg.py +++ b/homeassistant/components/camera/mjpeg.py @@ -47,7 +47,7 @@ def async_setup_platform(hass, config, async_add_entities, """Set up a MJPEG IP Camera.""" if discovery_info: config = PLATFORM_SCHEMA(discovery_info) - async_add_entities([MjpegCamera(hass, config)]) + async_add_entities([MjpegCamera(config)]) def extract_image_from_mjpeg(stream): @@ -65,7 +65,7 @@ def extract_image_from_mjpeg(stream): class MjpegCamera(Camera): """An implementation of an IP camera that is reachable over a URL.""" - def __init__(self, hass, device_info): + def __init__(self, device_info): """Initialize a MJPEG camera.""" super().__init__() self._name = device_info.get(CONF_NAME) diff --git a/homeassistant/components/camera/zoneminder.py b/homeassistant/components/camera/zoneminder.py index bda50a6f75c..55d8d91d3ee 100644 --- a/homeassistant/components/camera/zoneminder.py +++ b/homeassistant/components/camera/zoneminder.py @@ -28,21 +28,21 @@ def setup_platform(hass, config, add_entities, discovery_info=None): cameras = [] for monitor in monitors: _LOGGER.info("Initializing camera %s", monitor.id) - cameras.append(ZoneMinderCamera(hass, monitor)) + cameras.append(ZoneMinderCamera(monitor)) add_entities(cameras) class ZoneMinderCamera(MjpegCamera): """Representation of a ZoneMinder Monitor Stream.""" - def __init__(self, hass, monitor): + def __init__(self, monitor): """Initialize as a subclass of MjpegCamera.""" device_info = { CONF_NAME: monitor.name, CONF_MJPEG_URL: monitor.mjpeg_image_url, CONF_STILL_IMAGE_URL: monitor.still_image_url } - super().__init__(hass, device_info) + super().__init__(device_info) self._is_recording = None self._monitor = monitor -- GitLab