Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion homeassistant/components/button/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ async def _async_press_action(self) -> None:
self.async_write_ha_state()
await self.async_press()

async def async_added_to_hass(self) -> None:
async def async_internal_added_to_hass(self) -> None:
"""Call when the button is added to hass."""
await super().async_internal_added_to_hass()
state = await self.async_get_last_state()
if state is not None and state.state is not None:
self.__last_pressed = dt_util.parse_datetime(state.state)
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/scene/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ async def _async_activate(self, **kwargs: Any) -> None:
self.async_write_ha_state()
await self.async_activate(**kwargs)

async def async_added_to_hass(self) -> None:
"""Call when the button is added to hass."""
async def async_internal_added_to_hass(self) -> None:
"""Call when the scene is added to hass."""
await super().async_internal_added_to_hass()
state = await self.async_get_last_state()
if state is not None and state.state is not None:
self.__last_activated = state.state
Expand Down