State not keeping updated on change

Hello,

On my custom component, I turn on/off lights and switchs. When I turn on of off the entity, the state return to previous state in 1-2 sec, then get the right state when the next poll is done by home assistant:
lightturnoff_delay_state

Currently on the stable release, I do simple turn_on: https://github.com/Aohzan/ipx800/blob/d68a7ceef1826ed4da656726b0e0f9734090fdfc/custom_components/ipx800/light.py#L113

I tried to make async_turn_on, and ask an update, but the result is the same: https://github.com/Aohzan/ipx800/blob/1e32066c1e5c0852d4bac5df512423549c196f77/custom_components/ipx800/light.py#L74

Is there a solution to force the state of the entity untill the next polling update ?

Thanks :slight_smile:

Up! Can someone help me :pray:

I call await self.coordinator.async_request_refresh() after every action and it’s now ok:

Peek 2021-04-15 22-29