1
mirror of https://github.com/home-assistant/core synced 2024-10-07 10:13:38 +02:00
ha-core/homeassistant/components/foscam/const.py
Sergio Conde Gómez 2c74befd4f
Fix foscam to work again with non-admin accounts and make RTSP port configurable again (#45975)
* Do not require admin account for foscam cameras.

Foscam cameras require admin account for getting the MAC address,
requiring an admin account in the integration is not desirable as
an operator one is good enough (and a good practice).

Old entries using the MAC address as unique_id are migrated to the
new unique_id format so everything is consistent.

Also fixed unhandled invalid responses from the camera in the
config flow process.

* Make RTSP port configurable again as some cameras reports wrong port

* Remove periods from new log lines

* Set new Config Flow version to 2 and adjust the entity migration

* Create a proper error message for the InvalidResponse exception

* Change crafted unique_id to use entry_id in the entity

* Abort if same host and port is already configured

* Fix entry tracking to use entry_id instead of unique_id

* Remove unique_id from mocked config entry in tests
2021-02-05 22:39:31 +01:00

13 lines
221 B
Python

"""Constants for Foscam component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "foscam"
CONF_RTSP_PORT = "rtsp_port"
CONF_STREAM = "stream"
SERVICE_PTZ = "ptz"
SERVICE_PTZ_PRESET = "ptz_preset"