diff --git a/custom_components/frigate/binary_sensor.py b/custom_components/frigate/binary_sensor.py index dafc2e2b..65ea4dd8 100644 --- a/custom_components/frigate/binary_sensor.py +++ b/custom_components/frigate/binary_sensor.py @@ -71,7 +71,6 @@ def __init__( self._obj_name = obj_name self._is_on = False self._frigate_config = frigate_config - self._attr_entity_registry_visible_default = obj_name != "all" super().__init__( config_entry, diff --git a/custom_components/frigate/camera.py b/custom_components/frigate/camera.py index 32928ebd..425d8150 100644 --- a/custom_components/frigate/camera.py +++ b/custom_components/frigate/camera.py @@ -180,7 +180,6 @@ def __init__( self._cam_name = cam_name self._obj_name = obj_name self._last_image: bytes | None = None - self._attr_entity_registry_visible_default = False FrigateMQTTEntity.__init__( self, diff --git a/custom_components/frigate/sensor.py b/custom_components/frigate/sensor.py index 5ce72b4b..53a51c3f 100644 --- a/custom_components/frigate/sensor.py +++ b/custom_components/frigate/sensor.py @@ -86,7 +86,6 @@ def __init__( FrigateEntity.__init__(self, config_entry) CoordinatorEntity.__init__(self, coordinator) self._attr_entity_registry_enabled_default = False - self._attr_entity_registry_visible_default = False @property def unique_id(self) -> str: @@ -150,7 +149,6 @@ def __init__( CoordinatorEntity.__init__(self, coordinator) self._detector_name = detector_name self._attr_entity_registry_enabled_default = False - self._attr_entity_registry_visible_default = False @property def unique_id(self) -> str: @@ -220,7 +218,6 @@ def __init__( self._cam_name = cam_name self._fps_type = fps_type self._attr_entity_registry_enabled_default = False - self._attr_entity_registry_visible_default = False @property def unique_id(self) -> str: @@ -291,7 +288,6 @@ def __init__( self._obj_name = obj_name self._state = 0 self._frigate_config = frigate_config - self._attr_entity_registry_visible_default = False if self._obj_name == "person": self._icon = ICON_PERSON diff --git a/custom_components/frigate/switch.py b/custom_components/frigate/switch.py index 87be02e0..3cc385a6 100644 --- a/custom_components/frigate/switch.py +++ b/custom_components/frigate/switch.py @@ -42,13 +42,11 @@ async def async_setup_entry( for camera in frigate_config["cameras"].keys(): entities.extend( [ - FrigateSwitch(entry, frigate_config, camera, "detect", True, False), - FrigateSwitch(entry, frigate_config, camera, "motion", True, False), - FrigateSwitch(entry, frigate_config, camera, "recordings", True, True), - FrigateSwitch(entry, frigate_config, camera, "snapshots", True, True), - FrigateSwitch( - entry, frigate_config, camera, "improve_contrast", False, False - ), + FrigateSwitch(entry, frigate_config, camera, "detect", True), + FrigateSwitch(entry, frigate_config, camera, "motion", True), + FrigateSwitch(entry, frigate_config, camera, "recordings", True), + FrigateSwitch(entry, frigate_config, camera, "snapshots", True), + FrigateSwitch(entry, frigate_config, camera, "improve_contrast", False), ] ) async_add_entities(entities) @@ -66,7 +64,6 @@ def __init__( cam_name: str, switch_name: str, default_enabled: bool, - default_visible: bool, ) -> None: """Construct a FrigateSwitch.""" @@ -79,7 +76,6 @@ def __init__( ) self._attr_entity_registry_enabled_default = default_enabled - self._attr_entity_registry_visible_default = default_visible if self._switch_name == "snapshots": self._icon = ICON_IMAGE_MULTIPLE diff --git a/custom_components/frigate/update.py b/custom_components/frigate/update.py index 49310dcf..7b1f4a1a 100644 --- a/custom_components/frigate/update.py +++ b/custom_components/frigate/update.py @@ -46,7 +46,6 @@ def __init__( """Construct a FrigateContainerUpdate.""" FrigateEntity.__init__(self, config_entry) CoordinatorEntity.__init__(self, coordinator) - self._attr_entity_registry_visible_default = False @property def unique_id(self) -> str: diff --git a/tests/test_binary_sensor.py b/tests/test_binary_sensor.py index eb9f3b9b..03032c0c 100644 --- a/tests/test_binary_sensor.py +++ b/tests/test_binary_sensor.py @@ -183,8 +183,6 @@ async def test_binary_sensors_setup_correctly_in_registry( TEST_BINARY_SENSOR_FRONT_DOOR_MOTION_ENTITY_ID, TEST_BINARY_SENSOR_FRONT_DOOR_PERSON_OCCUPANCY_ENTITY_ID, TEST_BINARY_SENSOR_STEPS_PERSON_OCCUPANCY_ENTITY_ID, - }, - entities_hidden={ TEST_BINARY_SENSOR_FRONT_DOOR_ALL_OCCUPANCY_ENTITY_ID, TEST_BINARY_SENSOR_STEPS_ALL_OCCUPANCY_ENTITY_ID, }, diff --git a/tests/test_camera.py b/tests/test_camera.py index a56080ce..08d81131 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -232,6 +232,8 @@ async def test_cameras_setup_correctly_in_registry( TEST_CAMERA_FRONT_DOOR_ENTITY_ID, TEST_CAMERA_FRONT_DOOR_PERSON_ENTITY_ID, }, - entities_visible={TEST_CAMERA_FRONT_DOOR_ENTITY_ID}, - entities_hidden={TEST_CAMERA_FRONT_DOOR_PERSON_ENTITY_ID}, + entities_visible={ + TEST_CAMERA_FRONT_DOOR_ENTITY_ID, + TEST_CAMERA_FRONT_DOOR_PERSON_ENTITY_ID, + }, ) diff --git a/tests/test_sensor.py b/tests/test_sensor.py index c811adb7..efd1f6f8 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -392,7 +392,7 @@ async def test_sensors_setup_correctly_in_registry( TEST_SENSOR_CPU1_INTFERENCE_SPEED_ENTITY_ID, TEST_SENSOR_CPU2_INTFERENCE_SPEED_ENTITY_ID, }, - entities_hidden={ + entities_visible={ TEST_SENSOR_STEPS_ALL_ENTITY_ID, TEST_SENSOR_STEPS_PERSON_ENTITY_ID, TEST_SENSOR_FRONT_DOOR_ALL_ENTITY_ID, diff --git a/tests/test_switch.py b/tests/test_switch.py index c1caa74c..03ddec03 100644 --- a/tests/test_switch.py +++ b/tests/test_switch.py @@ -200,9 +200,7 @@ async def test_switches_setup_correctly_in_registry( entities_visible={ TEST_SWITCH_FRONT_DOOR_SNAPSHOTS_ENTITY_ID, TEST_SWITCH_FRONT_DOOR_RECORDINGS_ENTITY_ID, - }, - entities_hidden={ TEST_SWITCH_FRONT_DOOR_DETECT_ENTITY_ID, TEST_SWITCH_FRONT_DOOR_MOTION_ENTITY_ID, - }.union(DISABLED_SWITCH_ENTITY_IDS), + }, ) diff --git a/tests/test_update.py b/tests/test_update.py index 66f09800..cffe884b 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -119,5 +119,5 @@ async def test_update_sensor_setup_correctly_in_registry( await test_entities_are_setup_correctly_in_registry( hass, entities_enabled={TEST_UPDATE_FRIGATE_CONTAINER_ENTITY_ID}, - entities_hidden={TEST_UPDATE_FRIGATE_CONTAINER_ENTITY_ID}, + entities_visible={TEST_UPDATE_FRIGATE_CONTAINER_ENTITY_ID}, )