1 """Family Hub camera for Samsung Refrigerators."""
3 from __future__
import annotations
5 from pyfamilyhublocal
import FamilyHubCam
6 import voluptuous
as vol
9 PLATFORM_SCHEMA
as CAMERA_PLATFORM_SCHEMA,
19 DEFAULT_NAME =
"FamilyHub Camera"
21 PLATFORM_SCHEMA = CAMERA_PLATFORM_SCHEMA.extend(
23 vol.Required(CONF_IP_ADDRESS): cv.string,
24 vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
32 async_add_entities: AddEntitiesCallback,
33 discovery_info: DiscoveryInfoType |
None =
None,
35 """Set up the Family Hub Camera."""
37 address = config.get(CONF_IP_ADDRESS)
38 name = config.get(CONF_NAME)
41 family_hub_cam = FamilyHubCam(address, hass.loop, session)
47 """The representation of a Family Hub camera."""
50 """Initialize camera component."""
56 self, width: int |
None =
None, height: int |
None =
None
58 """Return a still image response."""
59 return await self.
family_hub_camfamily_hub_cam.async_get_cam_image()
63 """Return the name of this camera."""
64 return self.
_name_name
bytes|None async_camera_image(self, int|None width=None, int|None height=None)
def __init__(self, name, family_hub_cam)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)