Xiaomi Aqara devices shows data even when gateway is offline and it should show as unavailable

I have Xiaomi Aqara Gateway and some devices underneath it.
When the gateway is offline (unplugged) all those devices are still showing the last data in home assistant. What can i do so they would be showing as unavailable instead of latest data when the gateway was available?

I have similar problem with homekit that devices connected to haas when theyre not available in haas theyre showing status correctly (unavailable) but in homekit last state is being shoon all the time instead of unavailable…