Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cloud switch entity _update_state function a coro #647

Merged
merged 2 commits into from
Mar 6, 2024
Merged
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
5 changes: 2 additions & 3 deletions custom_components/spook/ectoplasms/cloud/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from homeassistant.components.cloud import DOMAIN as CLOUD_DOMAIN
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant, callback

from ...entity import SpookEntityDescription
from .entity import HomeAssistantCloudSpookEntity
Expand All @@ -18,6 +17,7 @@
from hass_nabucasa import Cloud

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback


Expand Down Expand Up @@ -119,8 +119,7 @@ class HomeAssistantCloudSpookSwitchEntity(HomeAssistantCloudSpookEntity, SwitchE
async def async_added_to_hass(self) -> None:
"""Register for switch updates."""

@callback
def _update_state(_: Any) -> None:
async def _update_state(_: Any) -> None:
"""Update state."""
self.async_schedule_update_ha_state()

Expand Down