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

Avoid use of hass.helpers and import function directly #955

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 custom_components/adaptive_lighting/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
callback,
)
from homeassistant.helpers import entity_platform, entity_registry
from homeassistant.helpers.entity_component import async_update_entity
from homeassistant.helpers.event import (
async_track_state_change_event,
async_track_time_interval,
Expand Down Expand Up @@ -2462,7 +2463,7 @@ async def significant_change(
# Ensure HASS is correctly updating your light's state with
# light.turn_on calls if any problems arise. This
# can happen e.g. using zigbee2mqtt with 'report: false' in device settings.
await self.hass.helpers.entity_component.async_update_entity(light)
await async_update_entity(self.hass, light)
refreshed_state = self.hass.states.get(light)
assert refreshed_state is not None

Expand Down
Loading