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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Hyperion camera post-merge code review #51457

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions homeassistant/components/hyperion/camera.py
Expand Up @@ -9,7 +9,7 @@
from contextlib import asynccontextmanager
import functools
import logging
from typing import Any, Callable
from typing import Any

from aiohttp import web
from hyperion import client
Expand All @@ -33,6 +33,7 @@
async_dispatcher_send,
)
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import HomeAssistantType

from . import (
Expand All @@ -56,8 +57,10 @@


async def async_setup_entry(
hass: HomeAssistantType, config_entry: ConfigEntry, async_add_entities: Callable
) -> bool:
hass: HomeAssistantType,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up a Hyperion platform from config entry."""
entry_data = hass.data[DOMAIN][config_entry.entry_id]
server_id = config_entry.unique_id
Expand Down Expand Up @@ -94,7 +97,6 @@ def instance_remove(instance_num: int) -> None:
)

listen_for_instance_updates(hass, config_entry, instance_add, instance_remove)
return True


# A note on Hyperion streaming semantics:
Expand Down Expand Up @@ -232,7 +234,6 @@ async def handle_async_mjpeg_stream(

async def async_added_to_hass(self) -> None:
"""Register callbacks when entity added to hass."""
assert self.hass
self.async_on_remove(
async_dispatcher_connect(
self.hass,
Expand Down