Skip to content
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

Clean up MjpegCamera by removing unnused hass object in __init__ #16628

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/camera/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/camera/mjpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/camera/zoneminder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down