Repository: home-assistant/core
File: homeassistant/components/renault/button.py (Python)

Code before:
    """Mixin for button specific attributes."""

    entity_description: RenaultButtonEntityDescription

    async def async_press(self) -> None:
        """Process the button press."""
        await self.entity_description.async_press(self)


BUTTON_TYPES: tuple[RenaultButtonEntityDescription, ...] = (
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.set_ac_start(21, None),
        key="start_air_conditioner",
        is_supported=lambda vehicle: vehicle.details.supports_endpoint("actions/hvac-start"),
        translation_key="start_air_conditioner",
    ),
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.set_charge_start(),
        key="start_charge",
        is_supported=lambda vehicle: vehicle.details.uses_electricity(),
        translation_key="start_charge",
    ),
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.set_charge_stop(),
        key="stop_charge",
        is_supported=lambda vehicle: vehicle.details.uses_electricity(),
        translation_key="stop_charge",
    ),
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.start_horn(),
        key="start_horn",
        is_supported=lambda vehicle: vehicle.details.supports_endpoint("actions/horn-start"),
        translation_key="start_horn",
    ),
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.start_lights(),
        key="start_lights",
        is_supported=lambda vehicle: vehicle.details.supports_endpoint("actions/lights-start"),
        translation_key="start_lights",
    ),
)


Review comment (suggestion):
This should also check `vehicle.details.supports_endpoint`
```suggestion
        is_supported=lambda vehicle: (
            vehicle.details.supports_endpoint("actions/charge-stop")
            and vehicle.details.uses_electricity()
        ),
```

Code after:
class RenaultButtonEntity(RenaultEntity, ButtonEntity):
    """Mixin for button specific attributes."""

    entity_description: RenaultButtonEntityDescription

    async def async_press(self) -> None:
        """Process the button press."""
        await self.entity_description.async_press(self)


BUTTON_TYPES: tuple[RenaultButtonEntityDescription, ...] = (
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.set_ac_start(21, None),
        key="start_air_conditioner",
        is_supported=lambda vehicle: (
            vehicle.details.supports_endpoint("actions/hvac-start")
        ),
        translation_key="start_air_conditioner",
    ),
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.set_charge_start(),
        key="start_charge",
        is_supported=lambda vehicle: (
            vehicle.details.supports_endpoint("actions/charge-start")
            and vehicle.details.uses_electricity()
        ),
        translation_key="start_charge",
    ),
    RenaultButtonEntityDescription(
        async_press=lambda x: x.vehicle.set_charge_stop(),
        key="stop_charge",
        is_supported=lambda vehicle: (
            vehicle.details.supports_endpoint("actions/charge-stop")
            and vehicle.details.uses_electricity()
        ),
        translation_key="stop_charge",
    ),
)