How does Flex detect motion when on battery?