Xiaomi Gateway Error with Binary Sensors

I can’t seem to get my Xiaomi gateway to fully work. I am getting readings from the Temperature/Humidity/Pressure sensors just fine, as well as the Luminance sensors built into my gen 2 Motion detectors, but the motion detectors, as well as the flood sensors, are not showing up in Home Assistant like they used to.

I’m getting this error on startup:

Error while setting up platform xiaomi_aqara
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/binary_sensor/xiaomi_aqara.py", line 36, in setup_platform
    devices.append(XiaomiWaterLeakSensor(device, gateway))
  File "/config/custom_components/binary_sensor/xiaomi_aqara.py", line 223, in __init__
    xiaomi_hub, 'status', 'moisture')
  File "/config/custom_components/binary_sensor/xiaomi_aqara.py", line 68, in __init__
    XiaomiDevice.__init__(self, device, name, xiaomi_hub)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/xiaomi_aqara.py", line 219, in __init__
    self.parse_data(device['data'], device['raw_data'])
TypeError: parse_data() takes 2 positional arguments but 3 were given