Enable confirm error button in Husqvarna Automower by default (#123927)

This commit is contained in:
Thomas55555 2024-08-15 08:29:06 +02:00 committed by GitHub
parent 667414a457
commit 9911aa4ede
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,9 @@ async def async_setup_entry(
"""Set up button platform."""
coordinator = entry.runtime_data
async_add_entities(
AutomowerButtonEntity(mower_id, coordinator) for mower_id in coordinator.data
AutomowerButtonEntity(mower_id, coordinator)
for mower_id in coordinator.data
if coordinator.data[mower_id].capabilities.can_confirm_error
)
@ -33,7 +35,6 @@ class AutomowerButtonEntity(AutomowerAvailableEntity, ButtonEntity):
"""Defining the AutomowerButtonEntity."""
_attr_translation_key = "confirm_error"
_attr_entity_registry_enabled_default = False
def __init__(
self,

View File

@ -34,7 +34,6 @@ from tests.common import (
@pytest.mark.freeze_time(datetime.datetime(2024, 2, 29, 11, tzinfo=datetime.UTC))
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_button_states_and_commands(
hass: HomeAssistant,
mock_automower_client: AsyncMock,