Binary_sensor: xiaomi_aqara.py vs xiaomi.py

Hi,

i want to change the Scan interval for Xiaomi motion sensor,

i found this topic:

and this 2 components:

https://github.com/NidalM/home-assistant/blob/master/homeassistant/components/binary_sensor/xiaomi_aqara.py

and

https://gitlab.udev.se/thomas/home-assistant-conf/blob/0c6ecd804c656f8576ff879d9b2a23419b10c5ad/custom_components/binary_sensor/xiaomi.py

I have some questions :

1- What the difference ?
2- i Have Mija gateway and some of my sensors are mija and some aqara, what i need to use?
3- anyone improve the scan interval from the Xiaomi sensors?

Tnx