Don't enable number of collisions by default for Husqvarna Automower (#131665)

This commit is contained in:
Thomas55555 2024-11-26 21:38:46 +01:00 committed by GitHub
parent a0893bb9f7
commit 055c38a3c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -349,6 +349,7 @@ MOWER_SENSOR_TYPES: tuple[AutomowerSensorEntityDescription, ...] = (
key="number_of_collisions",
translation_key="number_of_collisions",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL,
exists_fn=lambda data: data.statistics.number_of_collisions is not None,
value_fn=attrgetter("statistics.number_of_collisions"),

View File

@ -111,6 +111,7 @@ async def test_work_area_sensor(
assert state.state == "my_lawn"
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
@pytest.mark.parametrize(
("sensor_to_test"),
[
@ -167,6 +168,7 @@ async def test_error_sensor(
assert state.state == expected_state
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_sensor_snapshot(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,