def add_device_service(call):
    'Service to add a new sub-device within the next 30 seconds.'
    gateway = call.data.get(ATTR_GW_MAC)
    gateway.write_to_hub(gateway.sid, join_permission='yes')
    hass.components.persistent_notification.async_create('Join permission enabled for 30 seconds! Please press the pairing button of the new device once.', title='Xiaomi Aqara Gateway')
Service to add a new sub-device within the next 30 seconds.
def add_device_service(call):
    
    gateway = call.data.get(ATTR_GW_MAC)
    gateway.write_to_hub(gateway.sid, join_permission='yes')
    hass.components.persistent_notification.async_create('Join permission enabled for 30 seconds! Please press the pairing button of the new device once.', title='Xiaomi Aqara Gateway')