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

Add device info to FOSCAM #98167

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Changes from 2 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
15 changes: 14 additions & 1 deletion homeassistant/components/foscam/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from .const import CONF_RTSP_PORT, CONF_STREAM, LOGGER, SERVICE_PTZ, SERVICE_PTZ_PRESET
from .const import (
CONF_RTSP_PORT,
CONF_STREAM,
DOMAIN,
LOGGER,
SERVICE_PTZ,
SERVICE_PTZ_PRESET,
)

DIR_UP = "up"
DIR_DOWN = "down"
Expand Down Expand Up @@ -107,6 +115,11 @@ def __init__(self, camera: FoscamCamera, config_entry: ConfigEntry) -> None:
self._rtsp_port = config_entry.data[CONF_RTSP_PORT]
if self._rtsp_port:
self._attr_supported_features = CameraEntityFeature.STREAM
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, config_entry.entry_id)},
name=config_entry.title,
frenck marked this conversation as resolved.
Show resolved Hide resolved
manufacturer="Foscam",
)

async def async_added_to_hass(self) -> None:
"""Handle entity addition to hass."""
Expand Down