From f407dbd35c11f8701947bf6205ee4417ca5720eb Mon Sep 17 00:00:00 2001 From: RJPoelstra <36924801+RJPoelstra@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:46:41 +0100 Subject: [PATCH] Disable less used entities by default in MotionMount integration (#138509) * Mark sensors as disabled by default as most users won't need them * Mark entity-disabled-by-default as done * Enable disabled entities during tests --- homeassistant/components/motionmount/binary_sensor.py | 1 + homeassistant/components/motionmount/quality_scale.yaml | 2 +- homeassistant/components/motionmount/sensor.py | 1 + tests/components/motionmount/test_sensor.py | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/motionmount/binary_sensor.py b/homeassistant/components/motionmount/binary_sensor.py index d0d6825ee40..4bb880311f9 100644 --- a/homeassistant/components/motionmount/binary_sensor.py +++ b/homeassistant/components/motionmount/binary_sensor.py @@ -33,6 +33,7 @@ class MotionMountMovingSensor(MotionMountEntity, BinarySensorEntity): _attr_device_class = BinarySensorDeviceClass.MOVING _attr_translation_key = "motionmount_is_moving" _attr_entity_category = EntityCategory.DIAGNOSTIC + _attr_entity_registry_enabled_default = False def __init__( self, mm: motionmount.MotionMount, config_entry: MotionMountConfigEntry diff --git a/homeassistant/components/motionmount/quality_scale.yaml b/homeassistant/components/motionmount/quality_scale.yaml index 7df450d88f3..765cdd7e945 100644 --- a/homeassistant/components/motionmount/quality_scale.yaml +++ b/homeassistant/components/motionmount/quality_scale.yaml @@ -58,7 +58,7 @@ rules: comment: Single device per config entry entity-category: done entity-device-class: done - entity-disabled-by-default: todo + entity-disabled-by-default: done entity-translations: done exception-translations: done icon-translations: todo diff --git a/homeassistant/components/motionmount/sensor.py b/homeassistant/components/motionmount/sensor.py index 9ca8d2b0731..28fe921d9ac 100644 --- a/homeassistant/components/motionmount/sensor.py +++ b/homeassistant/components/motionmount/sensor.py @@ -49,6 +49,7 @@ class MotionMountErrorStatusSensor(MotionMountEntity, SensorEntity): ] _attr_translation_key = "motionmount_error_status" _attr_entity_category = EntityCategory.DIAGNOSTIC + _attr_entity_registry_enabled_default = False def __init__( self, mm: motionmount.MotionMount, config_entry: MotionMountConfigEntry diff --git a/tests/components/motionmount/test_sensor.py b/tests/components/motionmount/test_sensor.py index bb68c67ce62..0320e62d640 100644 --- a/tests/components/motionmount/test_sensor.py +++ b/tests/components/motionmount/test_sensor.py @@ -14,6 +14,7 @@ from tests.common import MockConfigEntry MAC = bytes.fromhex("c4dd57f8a55f") +@pytest.mark.usefixtures("entity_registry_enabled_by_default") @pytest.mark.parametrize( ("system_status", "state"), [