Change motionEye to use a two item device identifier tuple (#49774)

* Change to a two item device identifier tuple.

* Don't use join.
This commit is contained in:
Dermot Duffy 2021-04-27 14:48:27 -07:00 committed by GitHub
parent 513685bbea
commit 3fda66d9e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -52,9 +52,9 @@ def create_motioneye_client(
def get_motioneye_device_identifier( def get_motioneye_device_identifier(
config_entry_id: str, camera_id: int config_entry_id: str, camera_id: int
) -> tuple[str, str, int]: ) -> tuple[str, str]:
"""Get the identifiers for a motionEye device.""" """Get the identifiers for a motionEye device."""
return (DOMAIN, config_entry_id, camera_id) return (DOMAIN, f"{config_entry_id}_{camera_id}")
def get_motioneye_entity_unique_id( def get_motioneye_entity_unique_id(

View file

@ -18,7 +18,7 @@ TEST_URL = f"http://test:{DEFAULT_PORT+1}"
TEST_CAMERA_ID = 100 TEST_CAMERA_ID = 100
TEST_CAMERA_NAME = "Test Camera" TEST_CAMERA_NAME = "Test Camera"
TEST_CAMERA_ENTITY_ID = "camera.test_camera" TEST_CAMERA_ENTITY_ID = "camera.test_camera"
TEST_CAMERA_DEVICE_IDENTIFIER = (DOMAIN, TEST_CONFIG_ENTRY_ID, TEST_CAMERA_ID) TEST_CAMERA_DEVICE_IDENTIFIER = (DOMAIN, f"{TEST_CONFIG_ENTRY_ID}_{TEST_CAMERA_ID}")
TEST_CAMERA = { TEST_CAMERA = {
"show_frame_changes": False, "show_frame_changes": False,
"framerate": 25, "framerate": 25,